Skip to content

[erlc] internal error in beam_types:float_from_range/1 #7178

Closed
@RobinMorisset

Description

@RobinMorisset

Describe the bug
Running erlc on the following:

f2() ->
    2147483647.

f() ->
    round(
        try
            round(
                179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
            ) * f2()
        catch
            _ ->
                -0.0
        end
    ).

results in the following error message:

/home/rmorisset/minimized/test24255.erl: internal error in pass beam_asm:
exception error: bad argument
  in function  float/1
     called as float(386051660944098857979320112496874821662509824913761380052945899337282055494425751181671725242814549236624396401546869521246767425638465709087503243796055574778526910088956219915621397126611635770706705149229681374293733994399998202781202525698364132207013994004548876626207257120612756921674284558373367944351471108096)
     *** argument 1: not a number
  in call from beam_types:float_from_range/1 (beam_types.erl, line 1189)
  in call from beam_types:encode_ext_bits/4 (beam_types.erl, line 1513)
  in call from lists:foldl_1/3 (lists.erl, line 1599)
  in call from beam_types:encode_ext/1 (beam_types.erl, line 1504)
  in call from beam_dict:type/2 (beam_dict.erl, line 236)
  in call from beam_asm:encode_arg/2 (beam_asm.erl, line 438)
  in call from beam_asm:encode_op_1/3 (beam_asm.erl, line 429)

Affected versions

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions