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:
e28d582
)
[clang][Interp] Fix Pointer::toAPValue() for expressions
author
Timm Bäder
<tbaeder@redhat.com>
Mon, 16 Jan 2023 16:58:22 +0000
(17:58 +0100)
committer
Timm Bäder
<tbaeder@redhat.com>
Fri, 3 Feb 2023 13:30:05 +0000
(14:30 +0100)
Differential Revision: https://reviews.llvm.org/D141858
clang/lib/AST/Interp/Pointer.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/AST/Interp/Pointer.cpp
b/clang/lib/AST/Interp/Pointer.cpp
index
e25b4f8
..
8f1dfa3
100644
(file)
--- a/
clang/lib/AST/Interp/Pointer.cpp
+++ b/
clang/lib/AST/Interp/Pointer.cpp
@@
-103,6
+103,10
@@
APValue Pointer::toAPValue() const {
if (isUnknownSizeArray()) {
IsOnePastEnd = false;
Offset = CharUnits::Zero();
+ } else if (Desc->asExpr()) {
+ // Pointer pointing to a an expression.
+ IsOnePastEnd = false;
+ Offset = CharUnits::Zero();
} else {
// TODO: compute the offset into the object.
Offset = CharUnits::Zero();