New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExitValue of intepreter left in broken state at interpreter construction #1858
Comments
Hi Chuck, Thanks for the report. The code you highlighed does look to be in error and I ; llvm/llvm-bugzilla-archive#1486 define void @doNothing() { define i32 @main() { I'm trying this on Linux, but I doubt platform makes a difference for this |
Comments from Chuck, via email: Here'e the function that's running, though I have seen it with something define void @evaluateDependents(float* %colorValue) { FunctionBlock: ; preds = %FnTemporariesBlock DestructorBlock: ; preds = %FunctionBlock declare float @fabsf(float) Here's how we call in: llvm::Function* pExecutableFunction = llvm::GenericValue GV = pEE->runFunction( pExecutableFunction, |
Chuck, I can't easily reproduce that (limited time here), but perhaps you could try Index: Interpreter.cppRCS file: /var/cvs/llvm/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp,v
Instead of memset'ing the whole thing, it just does the "union" part. That If this works for you, please let me know and I'll commit it and close this PR. Thanks, Reid. |
If your fix is applied to the intreter constructor and also to the void return Thank you for the quick turnaround. |
refs llvm#1858 レジスタ割り付け機能テストTP追加 See merge request a64fx-swpl/llvm-project!97
refs llvm#1858 テストデータ修正 See merge request a64fx-swpl/llvm-project!106
Extended Description
Interpreter::Interpreter(Module *M) : ExecutionEngine(M), TD(M) {
memset(&ExitValue, 0, sizeof(ExitValue)); <-----
...
}
The problem with this line is that it leaves the APInt value within
ExitValue in a broken state (bit width cannot be zero). If you run a
function with no return value through the interpreter it will crash as
the ExitValue is passed out of the interpreter's run function as it
gets to the APInt copy constructor.
This problem is easily reproducable with by running a void function through
the interpeter. I've seen this repro both on Mac OSX and Vista.
The text was updated successfully, but these errors were encountered: