File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -2683,6 +2683,12 @@ func TestExpr_crash(t *testing.T) {
26832683 require .Error (t , err )
26842684}
26852685
2686+ func TestExpr_crash_with_zero (t * testing.T ) {
2687+ code := "if\x00 "
2688+ _ , err := expr .Compile (code )
2689+ require .Error (t , err )
2690+ }
2691+
26862692func TestExpr_nil_op_str (t * testing.T ) {
26872693 // Let's test operators, which do `.(string)` in VM, also check for nil.
26882694
Original file line number Diff line number Diff line change @@ -329,6 +329,9 @@ func (p *Parser) parseVariableDeclaration() Node {
329329
330330func (p * Parser ) parseConditionalIf () Node {
331331 p .next ()
332+ if p .err != nil {
333+ return nil
334+ }
332335 nodeCondition := p .parseExpression (0 )
333336 p .expect (Bracket , "{" )
334337 expr1 := p .parseSequenceExpression ()
You can’t perform that action at this time.
0 commit comments