[cfe-commits] [PATCH] Fixed SrcMgr::FileInfo pointer magic issue in getContentCache()
Riku Palomäki
riku at multitouch.fi
Tue Nov 13 00:47:55 PST 2012
Hi,
uintptr_t SrcMgr::FileInfo::Data is used to store both a pointer value
and some additional flags. getContentCache-function tries to get only
the raw pointer value from Data, but fails to do so since it uses
wrong size int. At least on Windows 8 with 64-bit Visual Studio 2012
this function always returns corrupted pointers.
On some platforms unsigned long long would be actually too large for
this use. If this triggers a warning on gcc, maybe it should be
written like ~uintptr_t(7UL).
Btw, why on earth would you like to store pointers and additional
flags to the same variable, ran out of bits?
--
Riku Palomäki
MultiTouch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: srgmgr.fileinfo.pointer.crash.patch
Type: application/octet-stream
Size: 569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121113/9236052a/attachment.obj>
More information about the cfe-commits
mailing list