Skip to content

Commit 7fe9484

Browse files
committed
Merge pull request #1887 from pguyot/w41/jit-fix-register-leak-32bits
JIT: fix register leak in first_pass_bs_match_equal_colon_equal These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 01cccfc + 8f81439 commit 7fe9484

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/jit/src/jit.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,14 +2976,14 @@ first_pass_bs_match_equal_colon_equal(
29762976
),
29772977
MSt4 = MMod:and_(MSt3, Result, ?TERM_PRIMARY_CLEAR_MASK),
29782978
{MSt5, IntValue} = MMod:get_array_element(MSt4, {free, Result}, 1),
2979-
cond_jump_to_label({IntValue, '!=', PatternValue}, Fail, MMod, MSt5);
2979+
cond_jump_to_label({{free, IntValue}, '!=', PatternValue}, Fail, MMod, MSt5);
29802980
_ ->
29812981
MSt4 = MMod:shift_right(MSt3, Result, 4),
2982-
cond_jump_to_label({Result, '!=', PatternValue}, Fail, MMod, MSt4)
2982+
MSt5 = cond_jump_to_label({Result, '!=', PatternValue}, Fail, MMod, MSt4),
2983+
MMod:free_native_registers(MSt5, [Result])
29832984
end,
29842985
MSt7 = MMod:add(MSt6, BSOffsetReg, Size),
2985-
MSt8 = MMod:free_native_registers(MSt7, [Result]),
2986-
{J0 - 3, Rest3, MatchState, BSOffsetReg, MSt8}.
2986+
{J0 - 3, Rest3, MatchState, BSOffsetReg, MSt7}.
29872987

29882988
first_pass_bs_match_skip(MatchState, BSOffsetReg, J0, Rest0, MMod, MSt0) ->
29892989
{Stride, Rest1} = decode_literal(Rest0),

0 commit comments

Comments
 (0)