ensure that source buffer is always terminated by a uni::null (which isn't automatically true for basic_string<T>).
git-svn-id: svn://10.0.0.236/trunk@68828 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
b4becb1155
commit
c8f8269bbe
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user