aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-26 22:50:59 +0200
committerBjörn Gustavsson <[email protected]>2015-04-29 12:25:06 +0200
commitfa237854a74a24ac7b940b1333828d4fffec7b5a (patch)
tree541fd7aef2f33036eb83fff2effefb7c8a1173b4
parentcc322a3749218d1e704a351f8c815d653e8c24a4 (diff)
downloadotp-fa237854a74a24ac7b940b1333828d4fffec7b5a.tar.gz
otp-fa237854a74a24ac7b940b1333828d4fffec7b5a.tar.bz2
otp-fa237854a74a24ac7b940b1333828d4fffec7b5a.zip
beam_dict: Correct comparison in opcode/2
The intention of the comparison is to avoid unnecessary updates of the ">=" instead of ">". With the ">" comparison, typically every line instruction would cause the #asm{} record to be updated.
-rw-r--r--lib/compiler/src/beam_dict.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_dict.erl b/lib/compiler/src/beam_dict.erl
index ea51673fa3..68dc104dd3 100644
--- a/lib/compiler/src/beam_dict.erl
+++ b/lib/compiler/src/beam_dict.erl
@@ -65,7 +65,7 @@ new() ->
%% Remember the highest opcode.
-spec opcode(non_neg_integer(), bdict()) -> bdict().
-opcode(Op, Dict) when Dict#asm.highest_opcode > Op -> Dict;
+opcode(Op, Dict) when Dict#asm.highest_opcode >= Op -> Dict;
opcode(Op, Dict) -> Dict#asm{highest_opcode=Op}.
%% Returns the highest opcode encountered.