summaryrefslogtreecommitdiffstatshomepage
path: root/unix/main.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-12-19 00:01:32 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-12-19 00:01:49 +0200
commit8427c5b76c9326ab3bc060fb729c1f0dbe17facd (patch)
tree3dfd66f130e85f1d2f934893c298ea18c29aad39 /unix/main.c
parentf04329e93b7bfa5462f232832d64aac3dc52d5db (diff)
downloadmicropython-8427c5b76c9326ab3bc060fb729c1f0dbe17facd.tar.gz
micropython-8427c5b76c9326ab3bc060fb729c1f0dbe17facd.zip
unix/windows: Make sure that process exit code is portable 8-bit value.
This fixes FORCED_EXIT internal flag leaking into Windows exit code.
Diffstat (limited to 'unix/main.c')
-rw-r--r--unix/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/main.c b/unix/main.c
index 8a564dbfa5..a0396e5178 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -440,7 +440,7 @@ int main(int argc, char **argv) {
nlr_pop();
} else {
// uncaught exception
- return handle_uncaught_exception((mp_obj_t)nlr.ret_val);
+ return handle_uncaught_exception((mp_obj_t)nlr.ret_val) & 0xff;
}
if (mp_obj_is_package(mod)) {
@@ -504,7 +504,7 @@ int main(int argc, char **argv) {
#endif
//printf("total bytes = %d\n", m_get_total_bytes_allocated());
- return ret;
+ return ret & 0xff;
}
uint mp_import_stat(const char *path) {