Skip to content

Commit

Permalink
V0.9: On error there is no need to pop the scope.
Browse files Browse the repository at this point in the history
The error routines for task and function definitions were incorrectly
popping the scope. This should not be done since no scope was pushed.
Also assert that the current_task/function is 0 to catch that kind of
error like the other definition rules.
  • Loading branch information
caryr authored and steveicarus committed Jun 18, 2010
1 parent b2fd383 commit 4a7bab0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions parse.y
@@ -1,7 +1,7 @@

%{
/*
* Copyright (c) 1998-2009 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -2312,8 +2312,7 @@ module_item

| K_task automatic_opt IDENTIFIER error K_endtask
{
pform_pop_scope();
current_task = 0;
assert(current_task == 0);
delete[]$3;
}

Expand Down Expand Up @@ -2353,8 +2352,7 @@ module_item
}
| K_function automatic_opt function_range_or_type_opt IDENTIFIER error K_endfunction
{
pform_pop_scope();
current_task = 0;
assert(current_function == 0);
delete[]$4;
}

Expand Down

0 comments on commit 4a7bab0

Please sign in to comment.