[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y

Chris Lattner lattner at cs.uiuc.edu
Fri Oct 8 19:19:12 PDT 2004



Changes in directory llvm/lib/AsmParser:

llvmAsmParser.y updated: 1.203 -> 1.204
---
Log message:

Add a check to avoid an assertion on malformed input



---
Diffs of the changes:  (+3 -0)

Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.203 llvm/lib/AsmParser/llvmAsmParser.y:1.204
--- llvm/lib/AsmParser/llvmAsmParser.y:1.203	Tue Sep 14 00:43:23 2004
+++ llvm/lib/AsmParser/llvmAsmParser.y	Fri Oct  8 21:18:58 2004
@@ -2120,6 +2120,9 @@
     if (!isa<PointerType>($3->get()))
       ThrowException("Can't load from nonpointer type: " +
                      (*$3)->getDescription());
+    if (!cast<PointerType>($3->get())->getElementType()->isFirstClassType())
+      ThrowException("Can't load from pointer of non-first-class type: " +
+                     (*$3)->getDescription());
     $$ = new LoadInst(getVal(*$3, $4), "", $1);
     delete $3;
   }






More information about the llvm-commits mailing list