Permalink
Browse files

Getting rid of a bad entry on the stack when a function fails to parse.

Solves a segfault when a bad function is given.
  • Loading branch information...
1 parent 47f21a5 commit 1e2bb866b7712c697a972db35ce4403371b08b6e @pgoodman committed Jan 10, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 xy/lib/parser.cpp
View
@@ -1306,6 +1306,7 @@ namespace xy {
stack.push_back(def->statements);
if(!parse_function(def, true)) {
+ stack.pop_back();
delete def;
return false;
}
@@ -1392,6 +1393,7 @@ namespace xy {
stack.push_back(def->statements);
if(!parse_function(def, false)) {
+ stack.pop_back();
delete def;
return false;
}

0 comments on commit 1e2bb86

Please sign in to comment.