Skip to content

Commit

Permalink
fix: make realloc more robust to non-pointer casts as arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri91 committed Dec 19, 2024
1 parent 4134446 commit 6509c55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12740,7 +12740,7 @@ Value *CodeGenFunction::EmitCheerpBuiltinExpr(unsigned BuiltinID,
const Expr* existingMem = E->getArg(0);
const CastExpr* argCE=dyn_cast<CastExpr>(existingMem);

if ((!argCE || argCE->getSubExpr()->getType()->isVoidPointerType())) {
if ((!argCE || argCE->getSubExpr()->getType()->isVoidPointerType() || !argCE->getSubExpr()->getType()->isPointerType())) {
if (!asmjs) {
CGM.getDiags().Report(E->getArg(0)->getBeginLoc(), diag::err_cheerp_memintrinsic_type_unknown);
return 0;
Expand Down

0 comments on commit 6509c55

Please sign in to comment.