Commit 7697f425c0ff00548ff2395b9612a076fba5fc77
1 parent
d252fe9c
Added the 'daylight saving time' component in the type 'Date_and_Time' and
updated the two instructions (which should better be syscalls): 'convert_time_from_int' and 'convert_time_to_int'.
Showing
1 changed file
with
11 additions
and
4 deletions
Show diff stats
anubis_dev/vm/src/vm.cpp
| ... | ... | @@ -1570,16 +1570,18 @@ ci_decl(ret) |
| 1570 | 1570 | #ifdef debug_vm |
| 1571 | 1571 | if (debugging) { printf("\n Execution over.\n\n"); } |
| 1572 | 1572 | #endif |
| 1573 | -// printf("*********************** Machine %d has finished.\n",(int)MAM(m_pid)); | |
| 1573 | + //printf("*********************** Machine %d has finished.\n",(int)MAM(m_pid)); | |
| 1574 | 1574 | |
| 1575 | 1575 | assert(MAM(m_variables) != NULL); |
| 1576 | 1576 | MAM(m_allocator)->FreeDataSegment(MAM(m_variables)); |
| 1577 | 1577 | MAM(m_variables) = NULL; |
| 1578 | 1578 | |
| 1579 | - /* The stack is freed in 'AnubisProcess.cpp' in desctructor '~AnubisProcess'. */ | |
| 1579 | + /* The stack is freed in 'AnubisProcess.cpp' in destructor '~AnubisProcess'. */ | |
| 1580 | 1580 | |
| 1581 | + /* | |
| 1581 | 1582 | if (MAM(m_serial_buf) != NULL) LOGERROR("*********************** Machine %d has non NULL serialization buffer.\n", |
| 1582 | 1583 | (int)MAM(m_pid)); |
| 1584 | + */ | |
| 1583 | 1585 | |
| 1584 | 1586 | MAM(m_status) = finished; |
| 1585 | 1587 | MAM(m_steps) = 0; /* give up */ |
| ... | ... | @@ -5492,7 +5494,7 @@ ci_decl(convert_time_from_int) |
| 5492 | 5494 | struct tm *ta; |
| 5493 | 5495 | time_t arg = (time_t)(*(MAM(m_SP)-1)); |
| 5494 | 5496 | |
| 5495 | - if ((MAM(m_R) = MAM(m_allocator)->AllocateDataSegment(9)) == 0) | |
| 5497 | + if ((MAM(m_R) = MAM(m_allocator)->AllocateDataSegment(10)) == 0) | |
| 5496 | 5498 | { |
| 5497 | 5499 | MAM(m_status) = need_more_memory; |
| 5498 | 5500 | MAM(m_steps) = 0; |
| ... | ... | @@ -5513,6 +5515,7 @@ ci_decl(convert_time_from_int) |
| 5513 | 5515 | *(((U32 *)MAM(m_R))+6) = (ta->tm_sec); |
| 5514 | 5516 | *(((U32 *)MAM(m_R))+7) = (ta->tm_wday); |
| 5515 | 5517 | *(((U32 *)MAM(m_R))+8) = (ta->tm_yday); |
| 5518 | + *((U8 *)(((U32 *)MAM(m_R))+9)) = !!(ta->tm_isdst); | |
| 5516 | 5519 | } |
| 5517 | 5520 | MAM(m_IP) += 1; |
| 5518 | 5521 | } |
| ... | ... | @@ -5538,6 +5541,7 @@ ci_decl(convert_time_to_int) |
| 5538 | 5541 | ta.tm_hour = *(ptr+4); |
| 5539 | 5542 | ta.tm_min = *(ptr+5); |
| 5540 | 5543 | ta.tm_sec = *(ptr+6); |
| 5544 | + ta.tm_isdst = (U32)(*((U8 *)(ptr+9))); | |
| 5541 | 5545 | |
| 5542 | 5546 | return_time = mktime(&ta); |
| 5543 | 5547 | // printf("convert_time_to_int %d\n", return_time); |
| ... | ... | @@ -5623,6 +5627,7 @@ ci_decl(start) |
| 5623 | 5627 | ci_decl(finish) |
| 5624 | 5628 | { |
| 5625 | 5629 | trace |
| 5630 | + //printf("Machine %d has executed 'finished'.\n",(int)MAM(m_pid)); | |
| 5626 | 5631 | |
| 5627 | 5632 | assert(MAM(m_variables) != NULL); |
| 5628 | 5633 | MAM(m_allocator)->FreeDataSegment(MAM(m_variables)); |
| ... | ... | @@ -5630,10 +5635,12 @@ ci_decl(finish) |
| 5630 | 5635 | |
| 5631 | 5636 | assert((int)(MAM(m_SP)-MAM(m_SP_begin)) == 2); |
| 5632 | 5637 | |
| 5633 | - /* The stack is freed in 'AnubisProcess.cpp' in desctructor '~AnubisProcess'. */ | |
| 5638 | + /* The stack is freed in 'AnubisProcess.cpp' in destructor '~AnubisProcess'. */ | |
| 5634 | 5639 | |
| 5640 | + /* | |
| 5635 | 5641 | if (MAM(m_serial_buf) != NULL) LOGERROR("*********************** Machine %d has 'finish' non NULL serialization buffer.\n", |
| 5636 | 5642 | (int)MAM(m_pid)); |
| 5643 | + */ | |
| 5637 | 5644 | |
| 5638 | 5645 | MAM(m_status) = finished; |
| 5639 | 5646 | MAM(m_steps) = 0; | ... | ... |