Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /src/c/clos/accessor.d [3c4986] .. [8ac2ec] Maximize Restore

  Switch to side-by-side view

--- a/src/c/clos/accessor.d
+++ b/src/c/clos/accessor.d
@@ -60,6 +60,12 @@
 		cl_object table = _ecl_funcall3(@'slot-value',
 						ECL_CLASS_OF(instance),
 						@'clos::location-table');
+		/* The class might not be a standard class. This happens
+		 * when a nonstandard class inherits from a standard class
+		 * and does not add any new slot accessor.
+		 */
+		unlikely_if (Null(table))
+			return slot_name;
 		return ecl_gethash_safe(slot_name, table, OBJNULL);
 	}
 }
@@ -132,10 +138,11 @@
 	index = e->value;
 	if (ECL_FIXNUMP(index)) {
 		value = instance->instance.slots[ecl_fixnum(index)];
+	} else if (ecl_unlikely(!ECL_LISTP(index))) {
+		value = cl_slot_value(instance, index);
+	} else if (ecl_unlikely(Null(index))) {
+		FEerror("Error when accessing method cache for ~A", 1, gfun);
 	} else {
-		unlikely_if (!ECL_CONSP(index)) {
-			FEerror("Error when accessing method cache for ~A", 1, gfun);
-		}
 		value = ECL_CONS_CAR(index);
 	}
 	unlikely_if (value == ECL_UNBOUND) {
@@ -175,10 +182,11 @@
 	index = e->value;
 	if (ECL_FIXNUMP(index)) {
 		instance->instance.slots[ecl_fixnum(index)] = value;
+	} else if (ecl_unlikely(!ECL_LISTP(index))) {
+		clos_slot_value_set(value, instance, index);
+	} else if (ecl_unlikely(Null(index))) {
+		FEerror("Error when accessing method cache for ~A", 1, gfun);
 	} else {
-		unlikely_if (!ECL_CONSP(index)) {
-			FEerror("Error when accessing method cache for ~A", 1, gfun);
-		}
 		ECL_RPLACA(index, value);
 	}
 	@(return value)