get_prop_len opcode returns 0 when argument is 0 per Z-machine spec 1.1.
authorDavid Griffith <dave@661.org>
Sat, 13 Jul 2019 07:19:52 +0000 (00:19 -0700)
committerDavid Griffith <dave@661.org>
Sat, 13 Jul 2019 07:20:34 +0000 (00:20 -0700)
Copied from Windows Frotz.

src/common/object.c

index d2dc7e65385337ce179c56ba8336a41c7cd9c470..699035bb444ec6d7b31c853ea21884bfd614cc4e 100644 (file)
@@ -667,6 +667,11 @@ void z_get_prop_len (void)
     zword addr;
     zbyte value;
 
+    if (zargs[0] == 0) {
+       store (0); /* demanded by Spec 1.1 */
+       return;
+    }
+
     /* Back up the property pointer to the property id */
 
     addr = zargs[0] - 1;