bug fix #739
This commit is contained in:
parent
88d6870f93
commit
f3299e0667
18
TestSuite/CompilationSamples/Data.pas
Normal file
18
TestSuite/CompilationSamples/Data.pas
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
unit Data;
|
||||
|
||||
//обязательно params
|
||||
procedure p2(params o: array of Exception) := exit;//не обязательно короткая процедура
|
||||
|
||||
procedure p1 :=//не обязательно короткая процедура
|
||||
try
|
||||
if true then
|
||||
p2(nil);
|
||||
except
|
||||
//обязательно on do и использование переменной исключения в процедуре с params
|
||||
on e: Exception do
|
||||
|
||||
p2(e);
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
@ -903,7 +903,6 @@ namespace PascalABCCompiler.TreeConverter
|
|||
vdn = syntax_tree_visitor.context.add_field(get_temp_arr_name(), loc, pr.type, polymorphic_state.ps_static);
|
||||
else
|
||||
vdn = syntax_tree_visitor.context.add_var_definition_in_entry_scope(get_temp_arr_name(), loc);
|
||||
|
||||
}
|
||||
else if (syntax_tree_visitor.context.converted_type != null)
|
||||
vdn = syntax_tree_visitor.context.add_field(get_temp_arr_name(), loc, pr.type, polymorphic_state.ps_static);
|
||||
|
|
|
|||
|
|
@ -1798,6 +1798,12 @@ namespace PascalABCCompiler.TreeConverter
|
|||
statement_node stm = convert_strong(eh.statements);
|
||||
context.leave_code_block();
|
||||
sl = convertion_data_and_alghoritms.statement_list_stack.pop();
|
||||
if (sl.statements.Count > 0 || sl.local_variables.Count > 0)
|
||||
{
|
||||
sl.statements.AddElement(stm);
|
||||
stm = sl;
|
||||
}
|
||||
|
||||
exception_filter ef = new exception_filter(filter_type, lvr, stm, get_location(eh));
|
||||
efl.AddElement(ef);
|
||||
current_catch_excep = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue