[llvm-commits] [llvm-gcc-4.2] r50268 - /llvm-gcc-4.2/branches/Apple/Tak/gcc/llvm-backend.cpp
Dale Johannesen
dalej at apple.com
Fri Apr 25 10:38:39 PDT 2008
Author: johannes
Date: Fri Apr 25 12:38:39 2008
New Revision: 50268
URL: http://llvm.org/viewvc/llvm-project?rev=50268&view=rev
Log:
Prevent crashing in some cases of erroneous input.
Modified:
llvm-gcc-4.2/branches/Apple/Tak/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/branches/Apple/Tak/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Tak/gcc/llvm-backend.cpp?rev=50268&r1=50267&r2=50268&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Tak/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Tak/gcc/llvm-backend.cpp Fri Apr 25 12:38:39 2008
@@ -858,7 +858,9 @@
void reset_initializer_llvm(tree decl) {
// If there were earlier errors we can get here when DECL_LLVM has not
// been set. Don't crash.
- if ((errorcount || sorrycount) && !DECL_LLVM(decl))
+ // We can also get here when DECL_LLVM has not been set for some object
+ // referenced in the initializer. Don't crash then either.
+ if (errorcount || sorrycount)
return;
// Get or create the global variable now.
@@ -876,7 +878,9 @@
void reset_type_and_initializer_llvm(tree decl) {
// If there were earlier errors we can get here when DECL_LLVM has not
// been set. Don't crash.
- if ((errorcount || sorrycount) && !DECL_LLVM(decl))
+ // We can also get here when DECL_LLVM has not been set for some object
+ // referenced in the initializer. Don't crash then either.
+ if (errorcount || sorrycount)
return;
// Get or create the global variable now.
More information about the llvm-commits
mailing list