Bugzilla – Bug 234
[interpreter] va_list values silently corrupted by function calls
Last modified: 2004-02-25 17:06:00
You need to log in before you can comment on or make changes to this bug.
The 2003-08-11-VaListArg UnitTest fails on the Interpreter, on x86 and powerpc.
Do you think this bug is possible to fix, or is there some inherent limitation in the interpeter? Do you think it's a good candidate for being a 1.2 bug? -Chris
I'm not sure -- I haven't successfully analyzed it yet. My only hunch so far is that I think it only affects programs of the form: bar (va_list ap) { ...stuff involving foo's varargs... } foo (arg, ...) { va_list ap; va_start (arg, ap); bar (ap); ... }
Ok, I vaguely remember talking about this at one point. :) -Chris
Analysis: The iterator into the array of VarArgs stored in the stack of ExecutionContexts, which we were using as the Interpreter's va_list, could be invalidated upon entering a new ExecutionContext (because the stack might need to be resized, potentially making the VarArgs vector move in memory).
Fixed: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040223/012213.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040223/012214.html