diff options
author | sagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8> | 2010-02-11 22:40:10 (GMT) |
---|---|---|
committer | sagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8> | 2010-02-11 22:40:10 (GMT) |
commit | ca2d69f4a43f7209113ceee6773bd04bbe6bd317 (patch) | |
tree | 757568904d2f910365d9f92766b90f68ce31e4ba | |
parent | 68e0196f31f8d6fef0d7ccaa21c0f33d5fa5504e (diff) | |
download | cv2pdb-ca2d69f4a43f7209113ceee6773bd04bbe6bd317.zip cv2pdb-ca2d69f4a43f7209113ceee6773bd04bbe6bd317.tar.gz cv2pdb-ca2d69f4a43f7209113ceee6773bd04bbe6bd317.tar.bz2 |
added patch to convert binaries produced by Metroworks CodeWarrior
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | src/cv2pdb.cpp | 10 |
2 files changed, 11 insertions, 3 deletions
@@ -80,3 +80,7 @@ Version history * dmd-patch needed for long/ulong support (http://d.puremagic.com/issues/show_bug.cgi?id=3373)
* experimental hack to add lexical scope to local variables (dmd patch in
http://d.puremagic.com/issues/show_bug.cgi?id=3657 needed)
+
+Version 0.12
+
+ * added patch to convert binaries produced by Metroworks CodeWarrior
diff --git a/src/cv2pdb.cpp b/src/cv2pdb.cpp index 00ff969..a503eda 100644 --- a/src/cv2pdb.cpp +++ b/src/cv2pdb.cpp @@ -2037,8 +2037,12 @@ bool CV2PDB::createSrcLineBitmap() for (int s = 0; s < segMap->cSeg; s++)
{
- srcLineStart[s] = new char[segMapDesc[s].cbSeg];
- memset(srcLineStart[s], 0, segMapDesc[s].cbSeg);
+ // cbSeg=-1 found in binary created by Metroworks CodeWarrior, so avoid new char[(size_t)-1]
+ if (segMapDesc[s].cbSeg <= LONG_MAX)
+ {
+ srcLineStart[s] = new char[segMapDesc[s].cbSeg];
+ memset(srcLineStart[s], 0, segMapDesc[s].cbSeg);
+ }
}
for (int m = 0; m < countEntries; m++)
@@ -2105,7 +2109,7 @@ int CV2PDB::getNextSrcLine(int seg, unsigned int off) return -1; off -= segMapDesc[s].offset;
- if (off < 0 || off >= segMapDesc[s].cbSeg)
+ if (off < 0 || off >= segMapDesc[s].cbSeg || off > LONG_MAX)
return 0;
for (off++; off < segMapDesc[s].cbSeg; off++)
|