Bugzilla – Bug 99
Interpreter does not support the vaarg instruction
Last modified: 2003-11-13 00:08:26
You need to log in before you can comment on or make changes to this bug.
%tmp.10 = vaarg sbyte* %ap.0, sbyte* ; <sbyte*> [#uses=1] lli: Interpreter.h:135: void Interpreter::visitInstruction(Instruction&): Assertion `0 && "Instruction not interpretable yet!"' failed. The interpreter should support the 'vaarg' instruction, and it currently does not. I get the above assertion failure when testing 2003-05-07-VarArgs with lli.
2003-05-07-VarArgs and many other vaarg tests work now, but 2003-08-11-VaListArg still crashes.
narrowed it down to: #include <stdio.h> #include <stdarg.h> void test(char *fmt, va_list ap) { char *s; switch(*fmt++) { case 's': s = va_arg(ap, char *); printf("string %s\n", s); break; } va_end(ap); } void testVaListArg(char *fmt, ...) { va_list ap; va_start(ap, fmt); test(fmt, ap); va_end(ap); } int main() { testVaListArg("s", "abc"); return 0; }
This may be fixable by representing a va_list as a pair { ExecutionContext *, int } or (better?) as an iterator into the std::vector<GenericValue> that we use to store varargs, instead of just an int.
This bug is now fixed. The interpreter now does no worse than any other backend on the SingleSource/UnitTests! http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20031110/009480.html