[PATCH] [Sema] Prevent crash while trying to merge types

Richard Smith richard at metafoo.co.uk
Thu Apr 23 16:08:01 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/Sema/SemaDecl.cpp:2988-2991
@@ -2987,1 +2987,6 @@
 
+    // The function prototype might be null, in which case
+    // there's not point to keep going and trying to merge types.
+    if (!OldProto || !NewProto)
+      return true;
+
----------------
* This function should not return `true` without a diagnostic having been emitted.
* `NewProto` cannot be null here due to the check on line 2979.
* `OldProto` should not be null here due to the check on line 2978.

Perhaps the root cause of the problem is that we set the wrong value for `hasPrototype` up on line 1752? We should be checking whether the builtin type is in fact a `FunctionProtoType` rather than just assuming it is.

http://reviews.llvm.org/D9235

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list