projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16c8833
)
[clang][Interp][NFCI] Don't crash on void builtin functions
author
Timm Bäder
<tbaeder@redhat.com>
Sat, 7 Jan 2023 07:10:48 +0000
(08:10 +0100)
committer
Timm Bäder
<tbaeder@redhat.com>
Thu, 26 Jan 2023 06:32:33 +0000
(07:32 +0100)
classifyPrim() runs into a llvm_unreachable() for those.
clang/lib/AST/Interp/ByteCodeExprGen.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index aaab980ac81bcf12602c16e849debfb8eb15d432..316ba635643678a44b63eaf5d6a5aaa01e626bd4 100644
(file)
--- a/
clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/
clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@
-1479,10
+1479,9
@@
bool ByteCodeExprGen<Emitter>::VisitBuiltinCallExpr(const CallExpr *E) {
if (!this->emitCallBI(Func, E))
return false;
- if (DiscardResult) {
- QualType ReturnType = E->getCallReturnType(Ctx.getASTContext());
+ QualType ReturnType = E->getCallReturnType(Ctx.getASTContext());
+ if (DiscardResult && !ReturnType->isVoidType()) {
PrimType T = classifyPrim(ReturnType);
-
return this->emitPop(T, E);
}