Commit Graph

18 Commits

Author SHA1 Message Date
bobsayshilol
bb308b3ff4 Add missing guards around push/pop pragmas
This matches all the other places where we silence Windows warnings.
2024-10-27 22:02:34 +00:00
bobsayshilol
4f800a7fda Avoid undefined arithmetic shifting
The result of a left shift on a positive signed integer (Rune) must fit
into an unsigned integer otherwise it's undefined behaviour, as is left
shifting a negative integer by any amount. This code can only be hit if
|x >= 0xf0| and hence a left shift of 31 will always be undefined
unless the input is 0 or 1.

To avoid hitting this we can instead extend the lowest bit to be the
mask if we assume that ints are 2's complement, which we already do
elsewhere. This generates identical code in testing on Compiler
Explorer and the Odin test suite passes locally with this change.

Note that the original code would change to be defined behaviour in
C++20, however we are currently build with |-std=c++14| in the build
scripts.
2024-10-27 22:02:34 +00:00
Feoramund
8b305a4c67 Add UCG library to Odin compiler 2024-06-29 18:42:56 -04:00
gingerBill
ac5f5a33e9 gb_internal a lot 2022-12-18 21:17:07 +00:00
gingerBill
be76da2c90 Begin optimizing tokenizer; Replace gb_utf8_decode with utf8_decode (CC but easier to change later) 2021-08-01 23:56:17 +01:00
gingerBill
876820789e Add rune_is_letter_or_digit for tokenizer 2020-05-27 12:54:11 +01:00
gingerBill
4e21a4d46a Optimize rune_is_* procedures for tokenizer 2020-05-27 12:43:49 +01:00
gingerBill
218d1131e8 Change how foreign imports work for mac 2019-09-29 09:25:33 +01:00
gingerBill
2614830c69 Minor code organization change 2019-03-31 18:29:57 +01:00
gingerBill
547a2831c7 Clean up name mangling by using unique package names per project 2018-05-27 22:09:11 +01:00
Ginger Bill
9b61adb97d Build as C++ 2017-06-08 12:03:40 +01:00
Ginger Bill
4d30ef7eda Change extensions .cpp to .c 2016-11-23 12:29:50 +00:00
Ginger Bill
8ecfca0c9b Remove templated Map; replace with #include macro "templates" trick 2016-11-23 10:36:48 +00:00
Ginger Bill
f60dc7b0a7 Minor Style Fixes 2016-10-22 19:41:58 +01:00
Ginger Bill
b593332942 Minimal Dependency Map: Only build what is needed 2016-09-27 15:28:44 +01:00
Ginger Bill
0e2347e582 Filename as default import name; as .; as _; panic() 2016-09-21 14:46:56 +01:00
Ginger Bill
ae75ab169b Pointer arithmetic builtin procedures 2016-08-27 11:05:08 +01:00
gingerBill
dcbb2fcfbd Full Unicode Support 2016-08-15 15:02:45 +01:00