User Details
- User Since
- Nov 1 2018, 5:06 PM (256 w, 1 d)
Fri, Sep 15
struct V { int Sizes[2]; int FAM[] __counted_by(Sizes[0]); // Thoughts? };
-fbounds-safety doesn't allow this. In our internal adoption experience, we haven't encountered such use cases yet. So, I think it's best to make the model restrictive to avoid surprises. If we were to support it, I think it should at least be limited to cases where the array subscript expression is known to be in bounds at compile time, to avoid an OOB access when the counted_by argument is evaluated.
Aug 23 2023
Future additions will include supporting, FAMs and counts in sub-structures.
Aug 15 2023
The changes look good to me. Ideally, we could add tests with multiple attributes and possibly with other sugar types.
Aug 10 2023
We should add a test to exercise when Ty is wrapped by other sugar types. Could you try with typedef?
Dec 27 2018
So with 'i' it should actually work as a PC-relative mode. Gotcha, that totally makes sense. Thanks for confirming this @rnk.
Dec 26 2018
@rnk thanks for looking into this!! yes, I need someone to commit it on my behalf.
Dec 25 2018
Thanks for looking into this @rnk. I am adding a unit test for this patch. Let me know if the test looks okay.
Nov 30 2018
@rnk Thanks for looking into this.
Nov 2 2018
Thanks for having look at this. I had also looked at that part, but the problem here has to do with local linkage functions which do not use GOTOFF relocations so classifyLocalReference() just returns MO_NO_FLAG. That's the reason why the if (isGlobalStubReference(Subtarget.classifyGlobalReference(GV))) does not catch this. However, these local linkage functions still need to be accessed in a RIP-relative way in the PIC mode and thus should not be used as immediate values.