Skip to content

Remove generation of main function and inline it in __entry #165

@vladimirradosavljevic

Description

@vladimirradosavljevic

In generated __entry function, there is the simple call to main function:

define void @__entry() #16 {
entry:
  call void @main()
  br label %return

return:                                           ; preds = %entry
  call void @llvm.evm.stop()
  unreachable
}

While this is not a problem in optimized code (main function is always inlined in __entry), in non-optimized code we will run into an issue where PUSHDEPLOYADDRESS is not in the __entry function.
This should be fixed by removing main function and emit everything from that function to __entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions