diff options
author | John Högberg <[email protected]> | 2019-05-27 13:41:25 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-05-27 13:41:25 +0200 |
commit | a65825e8f14f8e2c9aa9d5f95971199b98eee9ee (patch) | |
tree | c65d0be9c9fa5de3596cd5a546e31f0c5313fc54 /lib/compiler/src | |
parent | bdcc5c68d52ffcefce2890aa5454f2d2078be29e (diff) | |
parent | c267e7d5f69bcd620c698df0c807c5e3d4492f21 (diff) | |
download | otp-a65825e8f14f8e2c9aa9d5f95971199b98eee9ee.tar.gz otp-a65825e8f14f8e2c9aa9d5f95971199b98eee9ee.tar.bz2 otp-a65825e8f14f8e2c9aa9d5f95971199b98eee9ee.zip |
Merge branch 'john/misc-fixes-and-additions'
* john/misc-fixes-and-additions:
beam_validator: Fail when trying to set the type of a dead value
beam_validator: Fix bad comment formatting/wording
erts: Assert that GC should not be disabled twice
Diffstat (limited to 'lib/compiler/src')
-rw-r--r-- | lib/compiler/src/beam_validator.erl | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl index b4acebbfae..0ae3b4ed1f 100644 --- a/lib/compiler/src/beam_validator.erl +++ b/lib/compiler/src/beam_validator.erl @@ -200,7 +200,7 @@ validate_0(Module, [{function,Name,Ar,Entry,Code}|Fs], Ft) -> numy=none :: none | undecided | index(), %% Available heap size. h=0, - %Available heap size for floats. + %%Available heap size for floats. hf=0, %% Floating point state. fls=undefined, @@ -240,7 +240,7 @@ index_parameter_types([{function,_,_,Entry,Code0}|Fs], Acc0) -> Acc = index_parameter_types_1(Is, Entry, Acc0), index_parameter_types(Fs, Acc); _ -> - %% Something serious is wrong. Ignore it for now. + %% Something is seriously wrong. Ignore it for now. %% It will be detected and diagnosed later. index_parameter_types(Fs, Acc0) end; @@ -1865,16 +1865,9 @@ get_reg_vref({y,_}=Src, #vst{current=#st{ys=Ys}}) -> end. set_type(Type, #value_ref{}=Ref, #vst{current=#st{vs=Vs0}=St}=Vst) -> - case Vs0 of - #{ Ref := #value{}=Entry } -> - Vs = Vs0#{ Ref => Entry#value{type=Type} }, - Vst#vst{current=St#st{vs=Vs}}; - #{} -> - %% Dead references may happen during type inference and are not an - %% error in and of themselves. If a problem were to arise from this - %% it'll explode elsewhere. - Vst - end. + #{ Ref := #value{}=Entry } = Vs0, + Vs = Vs0#{ Ref => Entry#value{type=Type} }, + Vst#vst{current=St#st{vs=Vs}}. new_value(Type, Op, Ss, #vst{current=#st{vs=Vs0}=St,ref_ctr=Counter}=Vst) -> Ref = #value_ref{id=Counter}, |