From 6f54b92d3205146a036ae695f7785108f61b9b15 Mon Sep 17 00:00:00 2001
From: Simon Brooke <simon@journeyman.cc>
Date: Thu, 5 Aug 2021 23:35:21 +0100
Subject: [PATCH] check_tag now works for vectorspace as well as consspace tags

All tests except bignum boundary tests still pass.
---
 src/memory/consspaceobject.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/memory/consspaceobject.c b/src/memory/consspaceobject.c
index c240c4d..06bf41c 100644
--- a/src/memory/consspaceobject.c
+++ b/src/memory/consspaceobject.c
@@ -37,14 +37,14 @@ bool check_tag( struct cons_pointer pointer, char *tag ) {
 
   result = strncmp( &cell.tag.bytes[0], tag, TAGLENGTH ) == 0;
 
-  if ( !result ) {
-    // if ( vectorpointp( pointer ) ) { <<< this line blows up!
-    // //  struct vector_space_object *vec = pointer_to_vso( pointer );
+  if ( result == false ) {
+    if ( strncmp( &cell.tag.bytes, VECTORPOINTTAG, TAGLENGTH ) == 0 ) {
+      struct vector_space_object *vec = pointer_to_vso( pointer );
 
-    // //   if ( vec != NULL ) {
-    // //     result = strncmp( &vec->header.tag.bytes[0], tag, TAGLENGTH ) == 0;
-    // //   }
-    // }
+      if ( vec != NULL ) {
+        result = strncmp( &vec->header.tag.bytes[0], tag, TAGLENGTH ) == 0;
+      }
+    }
   }
 
   return result;