Commit bf4183d
cmake: define NDEBUG on the QuickJS library target
QuickJS asserts list_empty(rt->gc_obj_list) at the end of JS_FreeRuntime.
On embedders that legitimately have non-cycle-collected refs to JS values
held by long-lived native code, the cycle collector cannot break those
pins and the assertion aborts the process at shutdown. After the assert,
QuickJS' own fallback code in JS_FreeRuntime walks gc_obj_list itself and
frees what's still there, so disabling the assert is safe.
Define NDEBUG only on the qjs (and qjs-libc) targets so the rest of the
project keeps assertions enabled in Debug builds.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a98aabf commit bf4183d
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| |||
0 commit comments