mirror of
https://github.com/fangyidong/json-simple.git
synced 2025-12-06 07:20:53 +03:00
Issue #12: Excessive memory consumption in parse() (contributed by glen.tw)
This commit is contained in:
@@ -46,7 +46,7 @@ FALLBACK_CH = .
|
|||||||
}
|
}
|
||||||
<STRING_BEGIN> \\ {sb.append('\\');}
|
<STRING_BEGIN> \\ {sb.append('\\');}
|
||||||
|
|
||||||
<YYINITIAL> \" { sb.delete(0, sb.length());yybegin(STRING_BEGIN);}
|
<YYINITIAL> \" { sb = null; sb = new StringBuffer(); yybegin(STRING_BEGIN);}
|
||||||
<YYINITIAL> {INT} { Long val=Long.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);}
|
<YYINITIAL> {INT} { Long val=Long.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);}
|
||||||
<YYINITIAL> {DOUBLE} { Double val=Double.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);}
|
<YYINITIAL> {DOUBLE} { Double val=Double.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);}
|
||||||
<YYINITIAL> "true"|"false" { Boolean val=Boolean.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);}
|
<YYINITIAL> "true"|"false" { Boolean val=Boolean.valueOf(yytext()); return new Yytoken(Yytoken.TYPE_VALUE, val);}
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ int getPosition(){
|
|||||||
}
|
}
|
||||||
case 25: break;
|
case 25: break;
|
||||||
case 4:
|
case 4:
|
||||||
{ sb.delete(0, sb.length());yybegin(STRING_BEGIN);
|
{ sb = null; sb = new StringBuffer(); yybegin(STRING_BEGIN);
|
||||||
}
|
}
|
||||||
case 26: break;
|
case 26: break;
|
||||||
case 16:
|
case 16:
|
||||||
|
|||||||
Reference in New Issue
Block a user