Skip to content

same arguments tailcall bug #83

Closed
Closed
@bobzhang

Description

@bobzhang

there is an edge case, when none of the arguments are changed, our optimization will take it as an expression and generate a return statment

let v = ref 0
let acc = ref 0

let rec loop n : int = 
   if !v > n then !acc else begin incr v ; loop n end

A quick fix is to use continue to mark it as a statement, so our engine will not return it, in the future we should have a way to explitly mark Js_output.t terminating...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions