aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-11-03 11:02:53 +0100
committerBjörn Gustavsson <[email protected]>2017-11-06 15:43:56 +0100
commitcfb75380fcba60058825815068eac8e402d10e40 (patch)
tree008efaa3187412f5713ea71f2a1530a4bcd6c2e9 /erts/emulator/beam
parent0c88933a6ea89250460532847529699774a60b2a (diff)
downloadotp-cfb75380fcba60058825815068eac8e402d10e40.tar.gz
otp-cfb75380fcba60058825815068eac8e402d10e40.tar.bz2
otp-cfb75380fcba60058825815068eac8e402d10e40.zip
Warn when $REFRESH_GEN_DEST() is not used after a GC
It is easy to to forget to use $REFRESH_GEN_DEST() in an instruction that has a general destionation ('d'). Add a heuristic that should catch most if not all such problems.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/macros.tab9
1 files changed, 4 insertions, 5 deletions
diff --git a/erts/emulator/beam/macros.tab b/erts/emulator/beam/macros.tab
index e0b5f56b53..494fe8961e 100644
--- a/erts/emulator/beam/macros.tab
+++ b/erts/emulator/beam/macros.tab
@@ -20,13 +20,12 @@
//
//
-// Use if there is a garbage collection before storing to a
-// general destination (either X or Y register).
+// Define a regular expression that will match instructions that
+// perform GC. That will allow beam_makeops to check for instructions
+// that don't use $REFRESH_GEN_DEST() when they should.
//
-REFRESH_GEN_DEST() {
- dst_ptr = REG_TARGET_PTR(dst);
-}
+GC_REGEXP=erts_garbage_collect|erts_gc|GcBifFunction;
// $Offset is relative to the start of the instruction (not to the
// location of the failure label reference). Since combined