asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

Calling a function from a different module segfaults #21

Closed perimosocordiae closed 3 years ago

perimosocordiae commented 3 years ago

To reproduce:

bazel build -c dbg //compiler:interpret
./bazel-bin/compiler/interpret examples/factorial.ic --log VerifyCallee,VerifyCall

The segfault happens in Compiler::VerifyCallee here: https://github.com/asoffer/Icarus/blob/55fd07ab40cec4b99aff180bc54526b15434bd72/compiler/verify/common.cc#L375

because the expression context().qual_type(overload) results in a nullptr. This happens for all the Print overloads in the io module.