bug fixed

This commit is contained in:
Valk Richard Li 2020-09-16 03:34:28 -07:00 committed by GitHub
parent cf0718387b
commit 99e1ba77ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -196,6 +196,8 @@ std::string trans_number_to_string(double number)
trans_num_string+='-';
number=-number;
}
if(number==0)
return "0";
double integer_bit=1;
while(number>=integer_bit)
integer_bit*=10;

View File

@ -490,13 +490,14 @@ int nasal_runtime::loop_progress(nasal_ast& node,int local_scope_addr,bool allow
int condition_value_addr=calculation(condition_node,for_local_scope_addr);
bool result=check_condition(condition_value_addr);
nasal_vm.del_reference(condition_value_addr);
for(;result;ret_state=after_each_for_loop(each_loop_do_node,for_local_scope_addr))
while(result)
{
if(ret_state==rt_error)
break;
ret_state=block_progress(run_block_node,for_local_scope_addr,allow_return);
if(ret_state==rt_error || ret_state==rt_return || ret_state==rt_break || error)
break;
ret_state=after_each_for_loop(each_loop_do_node,for_local_scope_addr);
condition_value_addr=calculation(condition_node,for_local_scope_addr);
result=check_condition(condition_value_addr);
nasal_vm.del_reference(condition_value_addr);