diff --git a/mozilla/js/js2/parser.cpp b/mozilla/js/js2/parser.cpp index 5dd3beda467..41146fcb605 100644 --- a/mozilla/js/js2/parser.cpp +++ b/mozilla/js/js2/parser.cpp @@ -39,6 +39,7 @@ JS::Reader::Reader(const String &source, const String &sourceLocation, uint32 in begin = b; p = b; end = b + Reader::source.size(); + Reader::source.append(uni::null); // ensure last character is always '\0' #ifdef DEBUG recordString = 0; #endif diff --git a/mozilla/js/js2/parser.h b/mozilla/js/js2/parser.h index 3156002aef1..74b93bde1d4 100644 --- a/mozilla/js/js2/parser.h +++ b/mozilla/js/js2/parser.h @@ -40,7 +40,7 @@ namespace JavaScript { const char16 *p; // Position in source text const char16 *end; // End of source text; *end is a null character public: - const String source; // Source text + String source; // Source text const String sourceLocation; // Description of location from which the source text came private: const uint32 initialLineNum; // One-based number of current line diff --git a/mozilla/js2/src/parser.cpp b/mozilla/js2/src/parser.cpp index 5dd3beda467..41146fcb605 100644 --- a/mozilla/js2/src/parser.cpp +++ b/mozilla/js2/src/parser.cpp @@ -39,6 +39,7 @@ JS::Reader::Reader(const String &source, const String &sourceLocation, uint32 in begin = b; p = b; end = b + Reader::source.size(); + Reader::source.append(uni::null); // ensure last character is always '\0' #ifdef DEBUG recordString = 0; #endif diff --git a/mozilla/js2/src/parser.h b/mozilla/js2/src/parser.h index 3156002aef1..74b93bde1d4 100644 --- a/mozilla/js2/src/parser.h +++ b/mozilla/js2/src/parser.h @@ -40,7 +40,7 @@ namespace JavaScript { const char16 *p; // Position in source text const char16 *end; // End of source text; *end is a null character public: - const String source; // Source text + String source; // Source text const String sourceLocation; // Description of location from which the source text came private: const uint32 initialLineNum; // One-based number of current line