Ultimaker / CuraEngine

Powerful, fast and robust engine for converting 3D models into g-code instructions for 3D printers. It is part of the larger open source project Cura.
https://ultimaker.com/en/products/cura-software
GNU Affero General Public License v3.0
1.68k stars 882 forks source link

Fix refactoring crash #1993

Closed wawanbreton closed 10 months ago

wawanbreton commented 10 months ago

During refactory, the NO_INDEX macro was changed to avoid a warning of casting -1 to an unsigned int. In some cases, this would create a regression because unsigned int type is used instead of size_t.

Fix 1: In the specific buggy situation, use std::optional instead of NO_INDEX Fix 2: To avoid other similar situations, ensure that NO_INDEX is always used with size_t type

On longer term, we should remove the NO_INDEX macro and use std::optional instead.

github-actions[bot] commented 10 months ago

Unit Test Results

26 tests  ±0   26 :heavy_check_mark: ±0   6s :stopwatch: ±0s   1 suites ±0     0 :zzz: ±0    1 files   ±0     0 :x: ±0 

Results for commit 126c2ea8. ± Comparison against base commit 02190bdd.