From 5f8ec64d826f844ccc5e5f5b8767545e305a6e81 Mon Sep 17 00:00:00 2001 From: sagitario Date: Fri, 5 Jun 2009 09:56:53 +0000 Subject: v0.4: fix crash when long is used as index or element type of dynamic or associative arrays --- CHANGES | 7 ++++++- TODO | 1 + VERSION | 2 +- src/cv2pdb.cpp | 13 ++++++++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 5728ff6..2a729a9 100644 --- a/CHANGES +++ b/CHANGES @@ -18,7 +18,7 @@ Version history * support for field type LF_VFUNCTAB and symbol type S_CONSTANT used by DMC. * added stringview to autoexp.dat for full length text display. -2009-06-01 Version 0.3 +2009-06-04 Version 0.3 * static members' debug info was not correctly converted, causing debugger confusion * now works on executables compiled by DMC @@ -28,3 +28,8 @@ Version history * added fields __viewhelper to classes string and object * new addin dviewhelper.dll to display correctly terminated strings and derived object type + +2009-06-05 Version 0.4 + + * fixed crash when long is used as index or element type of dynamic or + associative arrays diff --git a/TODO b/TODO index 774b819..341b1b6 100644 --- a/TODO +++ b/TODO @@ -21,3 +21,4 @@ in the future, but not all have a known solution. * type display of delegate does not have arguments * assoc_array.length cannot be displayed (it is assoc_array.a->nodes) * enum values not displayed +* does not work with debug version of phobos diff --git a/VERSION b/VERSION index 29f5f7d..ef5fa03 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -VERSION = 0.3 +VERSION = 0.4 diff --git a/src/cv2pdb.cpp b/src/cv2pdb.cpp index f2ead36..49cb158 100644 --- a/src/cv2pdb.cpp +++ b/src/cv2pdb.cpp @@ -1079,7 +1079,7 @@ bool CV2PDB::nameOfAssocArray(int indexType, int elemType, char* name, int maxle bool CV2PDB::nameOfDelegate(int thisType, int funcType, char* name, int maxlen) { - strcat(name, "delegate "); + strcpy(name, "delegate "); int len = strlen(name); if (!nameOfType(funcType, name + len, maxlen - len)) return false; @@ -1101,6 +1101,9 @@ bool CV2PDB::nameOfOEMType(codeview_oem_type* oem, char* name, int maxlen) const char* CV2PDB::appendDynamicArray(int indexType, int elemType) { + indexType = translateType(indexType); + elemType = translateType(elemType); + codeview_reftype* rdtype; codeview_type* dtype; @@ -1173,6 +1176,9 @@ const char* CV2PDB::appendAssocArray(int keyType, int elemType) // elemType value; // }; + keyType = translateType(keyType); + elemType = translateType(elemType); + codeview_reftype* rdtype; codeview_type* dtype; codeview_fieldtype* dfieldtype; @@ -1297,6 +1303,9 @@ const char* CV2PDB::appendAssocArray(int keyType, int elemType) const char* CV2PDB::appendDelegate(int thisType, int funcType) { + thisType = translateType(thisType); + funcType = translateType(funcType); + codeview_reftype* rdtype; codeview_type* dtype; @@ -1735,6 +1744,8 @@ bool CV2PDB::addTypes() int rc = mod->AddTypes(globalTypes, cb); if (rc <= 0) return setError("cannot add type info to module"); + // does it make sense to add symbols more than once? + // break; } } return true; -- cgit v0.12