diff --git a/src/core/c-error.c b/src/core/c-error.c index 0d9d0d7dfb..1b1873b142 100644 --- a/src/core/c-error.c +++ b/src/core/c-error.c @@ -633,7 +633,7 @@ static REBOL_STATE Top_State; // Boot var: holds error state during boot val = Get_Object(spec, STD_PORT_SPEC_HEAD_REF); // most informative if (IS_NONE(val)) val = Get_Object(spec, STD_PORT_SPEC_HEAD_TITLE); - DS_PUSH_INTEGER(err_code); + DS_PUSH_INTEGER(-err_code); Trap2(errnum, val, DS_TOP); } diff --git a/src/core/n-io.c b/src/core/n-io.c index 961c205f3d..bba40062fe 100644 --- a/src/core/n-io.c +++ b/src/core/n-io.c @@ -592,7 +592,7 @@ static REBSER *Read_All_File(char *fname) REBVAL *arg = D_ARG(1); REBSER *ser; REBINT n; - REBVAL val, reason; + REBVAL val; ser = Value_To_OS_Path(arg, TRUE); // it should be safe not to check result from Value_To_OS_Path (it always succeeds) @@ -609,8 +609,8 @@ static REBSER *Read_All_File(char *fname) SET_FILE(arg, ser); if (NZ(n)) { - SET_INTEGER(&reason, n); - Trap2(RE_CANNOT_OPEN, arg, &reason); + SET_INTEGER(D_RET, -n); + Trap2(RE_CANNOT_OPEN, arg, D_RET); } return R_ARG1; }