================
@@ -52,14 +52,33 @@ static bool CheckWasmBuiltinArgIsInteger(Sema &S, CallExpr 
*E,
 }
 
 bool SemaWasm::BuiltinWasmRefNullExtern(CallExpr *TheCall) {
-  if (TheCall->getNumArgs() != 0)
+  if (TheCall->getNumArgs() != 0) {
----------------
hoodmane wrote:

If a positive number of arguments are provided, it crashes on this line:
https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaChecking.cpp?plain=1#L171

evaluating `Call->getArg(1)`. But I don't understand why that would crash. If 
we reach this point in the function, `CallExpr` must have at least one 
argument, so why should it be a problem to look it up? There is exactly one 
other instance of `SemaRef.checkArgCount(TheCall, 0)` in the code base, but 
it's possible that there is no test coverage for errors for that.

https://github.com/llvm/llvm-project/pull/139580
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to