txlyre hai 2 días
pai
achega
c461822d61
Modificáronse 1 ficheiros con 6 adicións e 6 borrados
  1. 6 6
      qirt.c

+ 6 - 6
qirt.c

@@ -2246,12 +2246,6 @@ qi_value_t *qi_call_debug(qi_state_t *state, qi_value_t *value,
 }
 
 static qi_bool _qi_guarded_equals(qi_state_t *state, qi_size_t depth, qi_list_t *tempstack, qi_value_t *a, qi_value_t *b) {
-  if (depth >= state->rlimit)
-    qi_throw_format(state, "recursion depth exceeded while comparing nested values");
-
-  if (a == b)
-    return true;
-  
   qi_value_t *meta;
   if ((meta = qi_call_meta(state, NULL, a, "__equals", 2, a, b))) {
     if (meta->type != QI_BOOLEAN)
@@ -2267,6 +2261,12 @@ static qi_bool _qi_guarded_equals(qi_state_t *state, qi_size_t depth, qi_list_t
     return meta->value.boolean;
   }
 
+  if (depth >= state->rlimit)
+    qi_throw_format(state, "recursion depth exceeded while comparing nested values");
+
+  if (a == b)
+    return true;
+
   if (a->type != b->type)
     return false;