aboutsummaryrefslogtreecommitdiff
path: root/symtab.h
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-07-16 11:27:00 -0700
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-07-17 03:30:50 +0900
commitf77417eb42dcf73badb47580ae3e1afc80de2820 (patch)
treef452157057e3e0e6e87af735ef2ebd9f587b74b4 /symtab.h
parentf24ed1478d7d22f014049bf866c9aa73ff70f23e (diff)
[C++] Fix Symtab on MacOSX
On MacOSX string objects will be copied when vector<string> grows and this invalidates StringPiece objects.
Diffstat (limited to 'symtab.h')
-rw-r--r--symtab.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/symtab.h b/symtab.h
index b2e772e..1e3ec74 100644
--- a/symtab.h
+++ b/symtab.h
@@ -22,7 +22,7 @@
using namespace std;
-extern vector<string>* g_symbols;
+extern vector<string*>* g_symbols;
class Symtab;
@@ -34,7 +34,7 @@ class Symbol {
}
const string& str() const {
- return (*g_symbols)[v_];
+ return *((*g_symbols)[v_]);
}
const char* c_str() const {