summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-02-08 09:43:56 -0500
committerPeter Zhu <[email protected]>2024-02-12 15:07:47 -0500
commit5644d90da0563fb5a9cdd6f5f3088f01b01ba06b (patch)
treeeac7a94c34f34e030db3def784123cdc0f8325c6
parentea92374bf727325fe96b5f65a41cdc1fc147af9e (diff)
Replace assert with RUBY_ASSERT in load.c
assert does not print the bug report, only the file and line number of the assertion that failed. RUBY_ASSERT prints the full bug report, which makes it much easier to debug.
-rw-r--r--load.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/load.c b/load.c
index 98f06265ed..5ccb526437 100644
--- a/load.c
+++ b/load.c
@@ -253,9 +253,9 @@ features_index_add_single_callback(st_data_t *key, st_data_t *value, st_data_t r
rb_darray_set(feature_indexes, top^0, FIX2LONG(this_feature_index));
rb_darray_set(feature_indexes, top^1, FIX2LONG(offset));
- assert(rb_darray_size(feature_indexes) == 2);
+ RUBY_ASSERT(rb_darray_size(feature_indexes) == 2);
// assert feature_indexes does not look like a special const
- assert(!SPECIAL_CONST_P((VALUE)feature_indexes));
+ RUBY_ASSERT(!SPECIAL_CONST_P((VALUE)feature_indexes));
*value = (st_data_t)feature_indexes;
}