diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-01-27 13:56:14 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-01-27 13:56:14 -0800 |
commit | 5bb09860276ee5a209abe526c922b838c01af549 (patch) | |
tree | 73d0bdf503b9a5aec74dcc169521d6aefb9becb5 /lib.c | |
parent | 75df8bf9079c5edf23f6b6d3c4b1c5902ddf9653 (diff) | |
download | txr-5bb09860276ee5a209abe526c922b838c01af549.tar.gz txr-5bb09860276ee5a209abe526c922b838c01af549.tar.bz2 txr-5bb09860276ee5a209abe526c922b838c01af549.zip |
* hash.c (hash_begin): Missing type check added, otherwise
passing in an object that is not a hash results in corruption
or crashing behavior.
* lib.c (class_check): Improved to a one-step check with a clear
message.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -169,9 +169,8 @@ val type_check3(val obj, int t1, int t2, int t3) val class_check(val cobj, val class_sym) { - type_check (cobj, COBJ); - type_assert (cobj->co.cls == class_sym, (lit("~a is not a cobj of class ~a"), - cobj, class_sym)); + type_assert (cobj && cobj->t.type == COBJ && cobj->co.cls == class_sym, + (lit("~a is not of type ~a"), cobj, class_sym, nao)); return t; } |