Skip to content

Commit 8427c5b

Browse files
committed
unix/windows: Make sure that process exit code is portable 8-bit value.
This fixes FORCED_EXIT internal flag leaking into Windows exit code.
1 parent f04329e commit 8427c5b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

unix/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ int main(int argc, char **argv) {
440440
nlr_pop();
441441
} else {
442442
// uncaught exception
443-
return handle_uncaught_exception((mp_obj_t)nlr.ret_val);
443+
return handle_uncaught_exception((mp_obj_t)nlr.ret_val) & 0xff;
444444
}
445445

446446
if (mp_obj_is_package(mod)) {
@@ -504,7 +504,7 @@ int main(int argc, char **argv) {
504504
#endif
505505

506506
//printf("total bytes = %d\n", m_get_total_bytes_allocated());
507-
return ret;
507+
return ret & 0xff;
508508
}
509509

510510
uint mp_import_stat(const char *path) {

0 commit comments

Comments
 (0)