chipsalliance / espresso

36 stars 14 forks source link

Fix crash on macOS by initializing the struct variable allocated on the stack #29

Open kammoh opened 9 months ago

kammoh commented 9 months ago

At least on macOS 14.2.1 (Apple clang version 15.0.0) Release build crashes with any input. As a result all tests fail as well. The segfault happens in make_sparse function, at the first iteration of evaluating ost.total == best_cost.total.

The issue is probably related to the way clang optimizes uninitialized structs and subsequent operations on uninitialized fields.

Anyways the fix is very simple and I don't think would affect build or execution or any other platform.

kammoh commented 9 months ago

Please rerun CI.