aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-07-19 17:01:02 +0200
committerJohn Högberg <[email protected]>2017-08-16 13:31:32 +0200
commit9beb6d48a12ae4e7abdacbed42b5269121f2fee7 (patch)
treec29ed91ab5217c225403bc5def09c18df53521ba
parentb6d68726e39b13721fe7cce77b0a2ef90bdc53c9 (diff)
downloadotp-9beb6d48a12ae4e7abdacbed42b5269121f2fee7.tar.gz
otp-9beb6d48a12ae4e7abdacbed42b5269121f2fee7.tar.bz2
otp-9beb6d48a12ae4e7abdacbed42b5269121f2fee7.zip
compiler: Fix live regs update on allocate in validator
The state without pruned registers was passed on to test_heap causing the validator to belive registers that aren't live actually are live.
-rw-r--r--lib/compiler/src/beam_validator.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index 16dba35adc..69e34f76b0 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -921,9 +921,9 @@ verify_call_match_context(Lbl, Ctx, #vst{ft=Ft}) ->
error({unsuitable_bs_start_match2,I})
end.
-allocate(Zero, Stk, Heap, Live, #vst{current=#st{numy=none}=St}=Vst0) ->
+allocate(Zero, Stk, Heap, Live, #vst{current=#st{numy=none}}=Vst0) ->
verify_live(Live, Vst0),
- Vst = prune_x_regs(Live, Vst0),
+ Vst = #vst{current=St} = prune_x_regs(Live, Vst0),
Ys = init_regs(Stk, case Zero of
true -> initialized;
false -> uninitialized