diff options
author | Björn Gustavsson <[email protected]> | 2018-03-20 07:27:36 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-03-23 14:35:29 +0100 |
commit | e48f59aff695e55c0150664a6cc4f441c1636a16 (patch) | |
tree | b230139f67fe6b71890671d5de730542f4a62ff3 /lib/compiler/src/beam_clean.erl | |
parent | cf3cbf0871832cb0808293842e5ae726edfc12e1 (diff) | |
download | otp-e48f59aff695e55c0150664a6cc4f441c1636a16.tar.gz otp-e48f59aff695e55c0150664a6cc4f441c1636a16.tar.bz2 otp-e48f59aff695e55c0150664a6cc4f441c1636a16.zip |
Allow the match context identifier to be any term
During compilation, the bs_save2 and bs_restore2 instructions contain a match
context reference. That reference is the variable name that holds the match context.
beam_clean assumes that the reference always is an atom, which is not a safe assumption
since integers are legal variable names in Core Erlang.
Diffstat (limited to 'lib/compiler/src/beam_clean.erl')
-rw-r--r-- | lib/compiler/src/beam_clean.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_clean.erl b/lib/compiler/src/beam_clean.erl index 7ddf9fa2e2..955c128699 100644 --- a/lib/compiler/src/beam_clean.erl +++ b/lib/compiler/src/beam_clean.erl @@ -254,7 +254,7 @@ bs_restores([_|Is], Dict) -> bs_restores([], Dict) -> Dict. %% Pass 2. -bs_replace([{test,bs_start_match2,F,Live,[Src,Ctx],CtxR}|T], Dict, Acc) when is_atom(Ctx) -> +bs_replace([{test,bs_start_match2,F,Live,[Src,{context,Ctx}],CtxR}|T], Dict, Acc) -> Slots = case gb_trees:lookup(Ctx, Dict) of {value,Slots0} -> Slots0; none -> 0 |