txlyre 2 天之前
父节点
当前提交
c461822d61
共有 1 个文件被更改,包括 6 次插入6 次删除
  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;