http://llvm.org/bugs/show_bug.cgi?id=5099
Summary: RewriteRope strictly undefined behavior, null 'this'
Product: clang
Version: unspecified
Platform: All
URL: http://clang.llvm.org/doxygen/RewriteRope_8h-source.html
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Basic
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
RewriteRope and RopeRefCountString rely on being able to call a
non-virtual member function on a null pointer and then test 'this'
in the member function implementation; see RopeRefCountString::addRef
and dropRef. This is undefined behavior in standard C++ and implementations
exist that will produce unexpected behavior (e.g. optimize away the test
on 'this' because it's flagged as a non-null argument). The fix is to
guard each call to addRef and dropRef with a test on the object pointer,
so that it is no longer necessary to test 'this' - there is no net
change in the number of runtime tests.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs