Commit b5ef96ca authored by John van Groningen's avatar John van Groningen

sign extend the result of wait_pid

parent 40dce80d
...@@ -417,7 +417,8 @@ Link linker winfun path ...@@ -417,7 +417,8 @@ Link linker winfun path
# (w_pid,status) = wait_pid linker_pid 0 # (w_pid,status) = wait_pid linker_pid 0
| w_pid <> -1 && w_pid<>linker_pid | w_pid <> -1 && w_pid<>linker_pid
= abort "waitpid failed" = abort "waitpid failed"
# result = (status bitand 0xff00) >> 8 # result = status >> 8;
# result = (result bitand 127) - (result bitand 128); // 8 bit sign extend
# wtermsig = status bitand 0x7f # wtermsig = status bitand 0x7f
| wtermsig<>0 | wtermsig<>0
= abort "linker exited abnormally" = abort "linker exited abnormally"
...@@ -448,8 +449,9 @@ Link linker winfun path ...@@ -448,8 +449,9 @@ Link linker winfun path
# (w_pid,status) = wait_pid ld_pid 0 # (w_pid,status) = wait_pid ld_pid 0
| w_pid <> -1 && w_pid<>ld_pid | w_pid <> -1 && w_pid<>ld_pid
= abort "waitpid failed" = abort "waitpid failed"
# result = (status bitand 0xff00) >> 8
# wtermsig = status bitand 0x7f # wtermsig = status bitand 0x7f
# result = status >> 8;
# result = (result bitand 127) - (result bitand 128); // 8 bit sign extend
| wtermsig<>0 | wtermsig<>0
= abort "ld exited abnormally" = abort "ld exited abnormally"
# link_ok = result>=0 # link_ok = result>=0
...@@ -493,7 +495,8 @@ Link linker winfun path ...@@ -493,7 +495,8 @@ Link linker winfun path
# (w_pid,status) = wait_pid linker_pid 0 # (w_pid,status) = wait_pid linker_pid 0
| w_pid <> -1 && w_pid<>linker_pid | w_pid <> -1 && w_pid<>linker_pid
= abort "waitpid failed" = abort "waitpid failed"
# result = (status bitand 0xff00) >> 8 # result = status >> 8;
# result = (result bitand 127) - (result bitand 128); // 8 bit sign extend
# wtermsig = status bitand 0x7f # wtermsig = status bitand 0x7f
| wtermsig<>0 | wtermsig<>0
= abort "linker exited abnormally" = abort "linker exited abnormally"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment