First Last Prev Next    No search results available
Details
: Interpreter does not support the vaarg instruction
Bug#: 99
: libraries
: Interpreter
Status: RESOLVED
Resolution: FIXED
: All
: All
: trunk
: P2
: normal
: 1.1

:
: missing-feature
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Brian R. Gaeke <gaeke+bugs@uiuc.edu>
Assigned To: Brian R. Gaeke <gaeke+bugs@uiuc.edu>
:

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2003-11-07 14:32
%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.
------- Comment #1 From Brian R. Gaeke 2003-11-07 15:22:55 -------
2003-05-07-VarArgs and many other vaarg tests work now, but 2003-08-11-VaListArg
still crashes.
------- Comment #2 From Brian R. Gaeke 2003-11-07 16:35:15 -------
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;
}
------- Comment #3 From Brian R. Gaeke 2003-11-07 16:38:38 -------
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.

------- Comment #4 From Brian R. Gaeke 2003-11-13 00:08:26 -------
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

First Last Prev Next    No search results available