core: Use unique assert_msg.

* src/mes.c (error): Use unique assert_msg.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-07-18 08:12:41 +02:00
parent adb145f4cc
commit a6c9002c32
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
3 changed files with 19 additions and 12 deletions

View file

@ -432,7 +432,7 @@ eval_apply:
else if (R3 == cell_unspecified) else if (R3 == cell_unspecified)
return R1; return R1;
else else
error (cell_symbol_system_error, make_string0 ("eval/apply unknown continuation")); assert_msg (0, "eval/apply unknown continuation");
evlis: evlis:
if (R1 == cell_nil) if (R1 == cell_nil)
@ -873,7 +873,11 @@ begin_expand:
else if (TYPE (R1) == TPORT) else if (TYPE (R1) == TPORT)
input = set_current_input_port (R1); input = set_current_input_port (R1);
else else
assert_msg (0, "0"); {
eputs ("begin_expand failed, R1=");
display_error_ (R1);
assert_msg (0, "begin-expand-boom 0");
}
push_cc (input, R2, R0, cell_vm_return); push_cc (input, R2, R0, cell_vm_return);
x = read_input_file_env (R0); x = read_input_file_env (R0);

View file

@ -46,24 +46,27 @@ hashq_ (SCM x, long size)
int int
hash_ (SCM x, long size) hash_ (SCM x, long size)
{ {
if (TYPE (x) == TSTRING) if (TYPE (x) != TSTRING)
return hash_cstring (cell_bytes (STRING (x)), size); {
assert_msg (0, "0"); eputs ("hash_ failed, not a string:");
return hashq_ (x, size); display_error_ (x);
assert_msg (0, "0");
}
return hash_cstring (cell_bytes (STRING (x)), size);
} }
SCM SCM
hashq (SCM x, SCM size) hashq (SCM x, SCM size)
{ {
eputs ("hashq not supporteed\n");
assert_msg (0, "0"); assert_msg (0, "0");
return make_number (hashq_ (x, VALUE (size)));
} }
SCM SCM
hash (SCM x, SCM size) hash (SCM x, SCM size)
{ {
eputs ("hash not supporteed\n");
assert_msg (0, "0"); assert_msg (0, "0");
return make_number (hash_ (x, VALUE (size)));
} }
SCM SCM

View file

@ -178,16 +178,16 @@ length (SCM x)
SCM SCM
error (SCM key, SCM x) error (SCM key, SCM x)
{ {
#if !__MESC_MES__ #if !__MESC_MES__ && !__M2_PLANET__
SCM throw; SCM throw = module_ref (R0, cell_symbol_throw);
if ((throw = module_ref (R0, cell_symbol_throw)) != cell_undefined) if (throw != cell_undefined)
return apply (throw, cons (key, cons (x, cell_nil)), R0); return apply (throw, cons (key, cons (x, cell_nil)), R0);
#endif #endif
display_error_ (key); display_error_ (key);
eputs (": "); eputs (": ");
write_error_ (x); write_error_ (x);
eputs ("\n"); eputs ("\n");
assert_msg (0, "0"); assert_msg (0, "ERROR");
exit (1); exit (1);
} }