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

rename result to exit_code and test if exit_code==0 instead of >=0 to...

rename result to exit_code and test if exit_code==0 instead of >=0 to determine if the linker succeeds
(clm uses r>=0 && status==0, but r is not result (now exit_code) in this function)
parent b5ef96ca
......@@ -416,16 +416,15 @@ Link linker winfun path
= abort "execution continued after execv"
# (w_pid,status) = wait_pid linker_pid 0
| w_pid <> -1 && w_pid<>linker_pid
= abort "waitpid failed"
# result = status >> 8;
# result = (result bitand 127) - (result bitand 128); // 8 bit sign extend
= abort "waitpid failed"
# exit_code = (status >> 8) bitand 0xff
# wtermsig = status bitand 0x7f
| wtermsig<>0
= abort "linker exited abnormally"
| free args_memory<0
= abort "free failed"
# link_ok = result>=0
# link_ok = exit_code==0
| not link_ok
| unlink (temp_file_name+++"\0")<>0
= (ps,link_ok)
......@@ -450,11 +449,10 @@ Link linker winfun path
| w_pid <> -1 && w_pid<>ld_pid
= abort "waitpid failed"
# wtermsig = status bitand 0x7f
# result = status >> 8;
# result = (result bitand 127) - (result bitand 128); // 8 bit sign extend
# exit_code = (status >> 8) bitand 0xff;
| wtermsig<>0
= abort "ld exited abnormally"
# link_ok = result>=0
# link_ok = exit_code==0
| unlink (temp_file_name+++"\0")<>0
= (ps,link_ok)
= (ps,link_ok)
......@@ -494,15 +492,14 @@ Link linker winfun path
= abort "execution continued after execv"
# (w_pid,status) = wait_pid linker_pid 0
| w_pid <> -1 && w_pid<>linker_pid
= abort "waitpid failed"
# result = status >> 8;
# result = (result bitand 127) - (result bitand 128); // 8 bit sign extend
= abort "waitpid failed"
# exit_code = (status >> 8) bitand 0xff
# wtermsig = status bitand 0x7f
| wtermsig<>0
= abort "linker exited abnormally"
| free args_memory<0
= abort "free failed"
# link_ok = result>=0
# link_ok = exit_code==0
= (ps,link_ok)
is_optimizing_linker :: !{#Char} -> Bool
......
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