aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-05-27 13:41:25 +0200
committerJohn Högberg <[email protected]>2019-05-27 13:41:25 +0200
commita65825e8f14f8e2c9aa9d5f95971199b98eee9ee (patch)
treec65d0be9c9fa5de3596cd5a546e31f0c5313fc54 /erts
parentbdcc5c68d52ffcefce2890aa5454f2d2078be29e (diff)
parentc267e7d5f69bcd620c698df0c807c5e3d4492f21 (diff)
downloadotp-a65825e8f14f8e2c9aa9d5f95971199b98eee9ee.tar.gz
otp-a65825e8f14f8e2c9aa9d5f95971199b98eee9ee.tar.bz2
otp-a65825e8f14f8e2c9aa9d5f95971199b98eee9ee.zip
Merge branch 'john/misc-fixes-and-additions'
* john/misc-fixes-and-additions: beam_validator: Fail when trying to set the type of a dead value beam_validator: Fix bad comment formatting/wording erts: Assert that GC should not be disabled twice
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_process.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 1f6adb98ef..e69a9b8813 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -11019,8 +11019,13 @@ erts_set_gc_state(Process *c_p, int enable)
ERTS_LC_ASSERT(ERTS_PROC_LOCK_MAIN == erts_proc_lc_my_proc_locks(c_p));
if (!enable) {
- c_p->flags |= F_DISABLE_GC;
- return 0;
+ /* Strictly speaking it's not illegal to disable the GC when it's
+ * already disabled, but we risk enabling the GC prematurely if (for
+ * example) a BIF were to blindly disable it when trapping and then
+ * re-enable it before returning its result. */
+ ASSERT(!(c_p->flags & F_DISABLE_GC));
+ c_p->flags |= F_DISABLE_GC;
+ return 0;
}
c_p->flags &= ~F_DISABLE_GC;