about summary refs log tree commit diff stats
path: root/021check_instruction.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-03-02 22:41:18 -0800
committerKartik K. Agaram <vc@akkartik.com>2017-03-02 22:41:18 -0800
commitb5f2a629c2617fc08a3b6d3fcc7d40f3974c8217 (patch)
treee803040bcbd8a08275bebe2d33ce89758ae1c142 /021check_instruction.cc
parente520e7989c207da66130b951d6268d11911b4fcc (diff)
downloadmu-b5f2a629c2617fc08a3b6d3fcc7d40f3974c8217.tar.gz
3752 - fix a couple of segfaults
Thanks Ella Couch for running into these.
Diffstat (limited to '021check_instruction.cc')
-rw-r--r--021check_instruction.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/021check_instruction.cc b/021check_instruction.cc
index 089033dc..48fe3adf 100644
--- a/021check_instruction.cc
+++ b/021check_instruction.cc
@@ -126,6 +126,7 @@ bool types_match(const reagent& to, const reagent& from) {
 //: copy arguments for later layers
 bool types_strictly_match(reagent/*copy*/ to, reagent/*copy*/ from) {
   // End Preprocess types_strictly_match(reagent to, reagent from)
+  if (to.type == NULL) return false;  // error
   if (is_literal(from) && to.type->value == get(Type_ordinal, "number")) return true;
   // to sidestep type-checking, use /unsafe in the source.
   // this will be highlighted in red inside vim. just for setting up some tests.