For PR1486:
authorReid Spencer <rspencer@reidspencer.com>
Fri, 1 Jun 2007 22:23:29 +0000 (22:23 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Fri, 1 Jun 2007 22:23:29 +0000 (22:23 +0000)
Avoid overwriting the APInt instance with 0 bytes which causes the bitwidth
to be set to 0 (illegal) producing a subsequent assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37391 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/Interpreter/Execution.cpp
lib/ExecutionEngine/Interpreter/Interpreter.cpp

index 0fff38cdec874fcd8a3b66ebd5e696890e92a70f..281f774193fc8357e102bbdc6ecfb7897326f65f 100644 (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,
index 0792edddc2120aa8fd2cfb182755d92dbff96f97..3a156bf51c3206274c2c4aac06c8b2d0959c0bc4 100644 (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();