Fix the interpreter crash that Michael McCracken found
authorChris Lattner <sabre@nondot.org>
Tue, 26 Oct 2004 05:35:14 +0000 (05:35 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 26 Oct 2004 05:35:14 +0000 (05:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17239 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/ExecutionEngine.cpp

index 208f8e2e834a2b22eb43e219feec089fca291850..7fb4ad3ae81bf063cf82bb1a7c8d19d7235ef6e7 100644 (file)
@@ -170,6 +170,7 @@ void *ExecutionEngine::getPointerToGlobal(const GlobalValue *GV) {
 /// 
 GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
   GenericValue Result;
+  if (isa<UndefValue>(C)) return Result;
 
   if (ConstantExpr *CE = const_cast<ConstantExpr*>(dyn_cast<ConstantExpr>(C))) {
     switch (CE->getOpcode()) {