[PATCH] D12821: Allow for C's "writing off the end" idiom in __builtin_object_size
George Burgess IV via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 14 11:49:21 PDT 2015
george.burgess.iv updated this revision to Diff 34710.
george.burgess.iv marked 4 inline comments as done.
george.burgess.iv added a comment.
Addressed all feedback -- added a walk of the Designator as suggested.
Regarding `isDesignatorAtObjectEnd`: I'm assuming that the Index returned by `FieldDescriptor::getFieldIndex` has some bearing on the actual position of the field in its parent. Specifically, that if `FD->getFieldIndex() + 1 == numFieldsIn(FD->getParent())`, then `FD` is the last field in its parent. I can't find documentation on this guarantee though, so I'm happy to swap to walking the offsets of each field in `FD->getParent()` if we feel that would be a more robust approach.
http://reviews.llvm.org/D12821
Files:
lib/AST/ExprConstant.cpp
test/CodeGen/object-size.c
test/CodeGen/object-size.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12821.34710.patch
Type: text/x-patch
Size: 16048 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150914/5f71203b/attachment.bin>
More information about the cfe-commits
mailing list