[PATCH] D137082: [clang][Interp] Fix dereferencing arrays with no offset applied

2023-01-25 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGad2fb01cb68d: [clang][Interp] Fix dereferencing arrays with no offset applied (authored by tbaeder). Changed prior to commit: https://reviews.llvm

[PATCH] D137082: [clang][Interp] Fix dereferencing arrays with no offset applied

2022-11-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! I think this is a more clear approach than the previous one. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137082/new/ https://reviews.llvm.org/D137082 __

[PATCH] D137082: [clang][Interp] Fix dereferencing arrays with no offset applied

2022-11-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 472887. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137082/new/ https://reviews.llvm.org/D137082 Files: clang/lib/AST/Interp/Pointer.h clang/test/AST/Interp/arrays.cpp Index: clang/test/AST/Interp/arrays.cpp ==

[PATCH] D137082: [clang][Interp] Fix dereferencing arrays with no offset applied

2022-11-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:966-967 return false; - S.Stk.push(Ptr.deref()); + // When getting the first value of an array, we need to offset to the + // first element. + if (Ptr.inArray() && Ptr.isRoot()) aar

[PATCH] D137082: [clang][Interp] Fix dereferencing arrays with no offset applied

2022-11-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:966-967 return false; - S.Stk.push(Ptr.deref()); + // When getting the first value of an array, we need to offset to the + // first element. + if (Ptr.inArray() && Ptr.isRoot()) --

[PATCH] D137082: [clang][Interp] Fix dereferencing arrays with no offset applied

2022-11-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D137082#3899032 , @aaron.ballman wrote: >> There is a difference between a Pointer and a "Pointer to the first element >> of an array". > > I'm pretty confused because this statement is false per the language standard > (htt

[PATCH] D137082: [clang][Interp] Fix dereferencing arrays with no offset applied

2022-11-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. > There is a difference between a Pointer and a "Pointer to the first element > of an array". I'm pretty confused because this statement is false per the language standard (http://eel.is/c++draft/expr.sub#2). Basically, array subscripting works through pointer ar

[PATCH] D137082: [clang][Interp] Fix dereferencing arrays with no offset applied

2022-10-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. There is a difference between a `Pointer` and a "`P