[cfe-dev] Small fixes to prevent runtime exceptions on MSVCRT
Argiris Kirtzidis
akyrtzi at gmail.com
Sat Feb 23 02:37:08 PST 2008
Hi,
The attached patch fixes some debug assertions that the msvcrt throws:
1)
- if (isprint(value) && value < 256) {
+ if (value < 256 && isprint(value)) {
isprint() does an assertion check of its own for value < 256; check
value before calling it to prevent it.
2)
- Stmt->Names.push_back(std::string(&data[0], data.size()));
+ if (data.size() == 0)
+ Stmt->Names.push_back(std::string());
+ else
+ Stmt->Names.push_back(std::string(&data[0], data.size()));
If data.size() == 0 then data[0] throws "out of range" assertion.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-runtime-exc-fix.zip
Type: application/octet-stream
Size: 534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080223/52867ed9/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: clang-runtime-exc-fix.patch
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080223/52867ed9/attachment.ksh>
More information about the cfe-dev
mailing list