Files
cadcraft/crates/dwg
BooksandBrandon Thomas f883454d7d DWG: post-read fix-ups run under catch_unwind; merge work is bounded (#1934) (#2402)
* DWG: post-read fix-ups run under catch_unwind; merge work is bounded (#1934)

table_merges and the other fix-ups on the acadrust document ran outside the
panic guard, and each merge range could visit rows x cols cells with no total
limit. They now run in one guarded post_process, and table_merges stops at
MAX_MERGE_CELLS cells in all. Tests: merge_work_is_bounded_by_the_cell_budget,
a_panic_in_post_processing_is_an_error.

* Parity checklist: regenerated after merging main

* DWG: test that the read and convert guards catch a panic through the public API (#2402)

The existing test only exercised guarded() itself. A test-only hook now makes post_process
or convert panic on entry, and tests go through dwg_to_dxf and dxf_to_dwg: both fail if
their guard is removed. convert()'s fix-ups, which run on the third-party reader's
document, are now under guarded() too, with their own error.

* Parity checklist: regenerated after merging main

* DWG: build the panic-test helpers only on native targets, like the tests that use them (#2402)

PanicIn and MINIMAL_DXF referenced the native-only PANIC_IN, so the dwg tests did not compile
for wasm32 (cargo check -p cadcraft-dwg --tests --target wasm32-unknown-unknown).

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-29 21:37:44 -04:00
..