[lli] Add a filter to avoid importing the process's main symbol.
authorLang Hames <lhames@gmail.com>
Thu, 2 Jan 2020 23:47:47 +0000 (15:47 -0800)
committerLang Hames <lhames@gmail.com>
Fri, 3 Jan 2020 00:05:23 +0000 (16:05 -0800)
commit355983103f008b094b5cdd26233eb0ed7113e7ec
treeb7f9a4d77825e90d0448ca26dc56279ed5157e84
parent3e5eac035801abe81c6c9d7512f924e2f6de41b5
[lli] Add a filter to avoid importing the process's main symbol.

If JIT'd code fails to define a main function and we import the process's
definition then we will end up recursively calling lli's main until we overflow
the stack and crash. This filter fixes the issue by ensuring that the process's
main function is never imported. This results in lli producing a much friendlier
"symbol not found" error when JIT'd code fails to define main.
llvm/tools/lli/lli.cpp