From e02a506408c38f4d86cdc17ff7f52b609ad101b7 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Thu, 13 Apr 2000 06:39:20 +0000 Subject: [PATCH] [not part of build] more heuristics for valid identifiers git-svn-id: svn://10.0.0.236/trunk@65784 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gc/boehm/typeinfo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mozilla/gc/boehm/typeinfo.cpp b/mozilla/gc/boehm/typeinfo.cpp index 5e4ae8ed7bf..f429d6f9cf9 100644 --- a/mozilla/gc/boehm/typeinfo.cpp +++ b/mozilla/gc/boehm/typeinfo.cpp @@ -9,6 +9,7 @@ */ #include +#include #include extern "C" const char* getTypeName(void* ptr); @@ -49,7 +50,10 @@ const char* getTypeName(void* ptr) void** vt = *(void***)ptr; if (space.contains(vt) && space.contains(*vt)) { IUnknown* u = static_cast(ptr); - return typeid(*u).name(); + const char* type = typeid(*u).name(); + // make sure it looks like a C++ identifier. + if (type && (isalnum(type[0]) || type[0] == '_')) + return type; } return "void*"; }