THURSDAY, OCTOBER 22, 2026
gccrs
gccrs: intrinsics: Fix invalid error check after improvements to builtin lookup
Corrects an assertion error in Rust-GCC's intrinsic handler for ctlz.
This commit fixes an assertion error in Rust-GCC’s intrinsic handler for ctlz (count leading zeros). The error occurred due to an incorrect comparison between a tl::optional<tree> and a tree after recent improvements to builtin lookup mechanisms. The fix ensures that the validity of the optional value is checked before comparison, preventing the assertion failure.
In Details
The ctlz_handler in rust-intrinsic-handlers.cc now correctly handles the return value from improved builtin lookup. Instead of directly comparing a tl::optional<tree> with a tree, it first checks if the tl::optional contains a valid tree, preventing an assertion failure.