[clang] [Clang] Fix crash for incompatible types in inline assembly (PR #119098)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 14:56:07 PST 2024


================
@@ -664,11 +664,22 @@ StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple,
       SmallerValueMentioned |= OutSize < InSize;
     }
 
+    // If the input is an integer register while the output is floating point,
+    // there is no way they can work together.
+    bool FPBoundToInt = false;
+    if (InputDomain != AD_FP && OutputDomain == AD_FP) {
+      FPBoundToInt = true;
+    }
+    if (InputDomain == AD_FP && OutputDomain != AD_FP) {
+      FPBoundToInt = true;
+    }
----------------
arsenm wrote:

This should be an initialization expression 

https://github.com/llvm/llvm-project/pull/119098


More information about the cfe-commits mailing list