|
From: | Nicolas Bértolo |
Subject: | bug#41615: [feature/native-comp] Dump prettier C code. |
Date: | Sun, 31 May 2020 16:38:15 -0300 |
> The whole compilation is something like 5x faster here. Amazing.I took a closer look at the code that uses casts to bools and I think I found a bug. Casting to bool using an enum is equivalent to taking the lowest byte using a byte mask. This wrongly casts to "false" integers whose lowest byte is nil. bool cast_from_unsigned_long_long_to_bool (unsigned long long x) { return (x & 0xFF); } The correct way to cast to bool is to mimic C semantics: bool cast_from_unsigned_long_long_to_bool (unsigned long long x) { if (x != 0) return true; else return false; } Am I right? Nico.
[Prev in Thread] | Current Thread | [Next in Thread] |