For PR1486:

Avoid overwriting the APInt instance with 0 bytes which causes the bitwidth
to be set to 0 (illegal) producing a subsequent assert.

llvm-svn: 37391
This commit is contained in:
Reid Spencer 2007-06-01 22:23:29 +00:00
parent ac54a62fd2
commit ff38cf8880
2 changed files with 2 additions and 2 deletions

View File

@ -610,7 +610,7 @@ void Interpreter::popStackAndReturnValueToCaller (const Type *RetTy,
if (RetTy && RetTy->isInteger()) { // Nonvoid return type?
ExitValue = Result; // Capture the exit value of the program
} else {
memset(&ExitValue, 0, sizeof(ExitValue));
memset(&ExitValue.Untyped, 0, sizeof(ExitValue.Untyped));
}
} else {
// If we have a previous stack frame, and we have a previous call,

View File

@ -54,7 +54,7 @@ ExecutionEngine *Interpreter::create(ModuleProvider *MP, std::string* ErrStr) {
//
Interpreter::Interpreter(Module *M) : ExecutionEngine(M), TD(M) {
memset(&ExitValue, 0, sizeof(ExitValue));
memset(&ExitValue.Untyped, 0, sizeof(ExitValue.Untyped));
setTargetData(&TD);
// Initialize the "backend"
initializeExecutionEngine();