Commit Graph
1156 Commits
Author SHA1 Message Date
gingerBill 3f518fd130 Merge pull request #7602 from corleypc/lifetime-markers
Adds lifetime markers for named locals
2026-09-29 17:44:06 +01:00
gingerBill 53f6f378d3 Merge pull request #7666 from odin-lang/bill/exact-value-big-float
Add `ExactValue_Rational` to improve precision on compiler float computation
2026-09-29 17:04:17 +01:00
gingerBill 383a2fe1e5 Reject complex/quaternion component overflow to match normal floats 2026-09-29 16:34:06 +01:00
gingerBill 28d8a790d7 Add more tests for the float constant builtins 2026-09-29 15:27:07 +01:00
Louis Novy 41d3f37fba Fix #5318: procedures passed to $ parameters share an instantiation's name 2026-09-29 10:21:43 -04:00
gingerBill 19f7b5e2e2 Add f16/f32 precision checks; Fix macOS MSIZE macro collision 2026-09-29 14:53:28 +01:00
gingerBill a910a0794d Add test_number_literals.odin 2026-09-29 14:39:15 +01:00
corleypc 6c5651638c Merge branch 'master' into lifetime-markers 2026-09-29 16:04:59 +03:00
gingerBill d7da8c0833 Merge pull request #7610 from bplu4t2f/fix-7547
Fix #7547 (double-null-terminate path in SHFileOperationW)
2026-09-29 13:28:35 +01:00
gingerBill 8e3dd40262 Merge pull request #7579 from jpgleeson/jackg/core-fastX-types
[core/c] Fix fastX type widths
2026-09-29 13:16:29 +01:00
gingerBill 88d2c3f11e Merge branch 'master' into fix-7547 2026-09-29 13:13:47 +01:00
gingerBill 5a4e0de0cc Merge pull request #7594 from bplu4t2f/fix-7583
Fix 7583: -strict-style requires comma before newline after proc parameters which have a default value.
2026-09-29 13:11:39 +01:00
gingerBill bd4f2821e1 Merge pull request #7630 from MatzeOGH/fast_float
Ported Eisel-Lemire's fast float algorithm to Odin
2026-09-29 13:09:28 +01:00
gingerBill 8640b38899 Merge pull request #7661 from louisnovy/fix-swizzle-through-pointer
Fix #7587: full length swizzles through a pointer keeping the pointer type
2026-09-29 13:06:24 +01:00
gingerBill f3ab1d4b3c Merge pull request #7639 from louisnovy/fix-array-programming-with-matrices
Fix #6302: broadcasting arrays of matrices and matrices
2026-09-29 13:05:33 +01:00
gingerBill 5a9c4c598b Merge pull request #7652 from louisnovy/fix-forwarded-poly-proc-param
Fix #6951 and #5214: `$` procedure arguments matching the wrong instantiation
2026-09-29 13:04:57 +01:00
gingerBill 3f24a82469 Merge pull request #7656 from alyekypo/fix/union-constant-non-constantable
fix(llvm): emit union constants for non-constantable unions
2026-09-29 13:03:37 +01:00
gingerBill 7a228a97f8 Merge pull request #7664 from odin-lang/bill/bit_set_backing
Allow `bit_set` to be backed by arrays of integers
2026-09-29 13:02:25 +01:00
gingerBill bd87143db7 Add some regression tests for bit_set backed by arrays 2026-09-29 12:20:52 +01:00
Louis Novy adc2059d36 Merge branch 'master' of https://github.com/odin-lang/Odin into fix-swizzle-through-pointer
# Conflicts:
#	tests/issues/run.bat
#	tests/issues/run.sh
2026-09-29 02:27:05 -04:00
Ihor Antonov 2109ba8fbd core: add strict base64 decoding
core:encoding/base64 currently decodes leniently: it infers padding from the
last one or two bytes, accepts missing/extra/interior padding, and does not
check the trailing padding bits required by RFC 4648 Section 3.5.
Go exposes canonical decoding as `Encoding.Strict()`; Odin has no equivalent,
so downstream ports (e.g. age) have to reimplement base64 from scratch.

This adds opt-in strict decoding through a `Decode_Options` bit set.
Existing calls and behavior are unchanged.
2026-09-28 19:59:23 -07:00
alyekypo b9c4067f78 fix(llvm): emit union constants for non-constantable unions
`constant: U : value` produced a constant of the wrong type:
lb_const_value took its union-lowering branch only when
`is_type_union_constantable(type)` held, so for a union with a variant
that whitelist rejects (`union{bool, ^int}`) the value fell through to
the scalar branch and reached `LLVMConstInt(lb_type(m, union_type),
...)`.  The constant emitted there does not match the union's type:
bytes that change between runs for `true`, a compiler crash for `1.0`,
an `is_type_string` assertion for a string literal.

The checker already resolves which variant a constant represents and
records it in `ExactValue::variant_type` - the variant type, tag index,
payload and padding the union branch needs - so that branch is now also
taken when the value pins a variant this backend can build as a
constant.  The type-level whitelist was re-guessing information the
value already carries; variant types this backend cannot build as
constants (`any`) stay excluded.

lb_build_static_variables had the same defect in another place: it
lowered an initializer with the expression's type instead of the
declared type, so `@(static) s: U` emitted a payload-only constant and
LLVM rejected the module with “Global variable initializer type does not
match global variable type!”.  It now passes the declared type and gives
the global the constant's layout-compatible type, the way the file-scope
path already does.

Blast radius: every union-typed constant, i.e. typed constants, global
static initializers, @(static)/@(thread_local)/@(rodata), default
parameters and constant aggregate elements.  Unions whose variants are
all constantable keep the previous path.
2026-09-28 19:32:04 +00:00
Louis Novy e9657d17b6 Cover #5214 in the forwarded $ procedure test 2026-09-28 09:58:59 -04:00
Louis Novy 7b10b43f08 Rename the forwarded $ procedure test after #6951 2026-09-28 09:47:53 -04:00
Louis Novy 35d5998039 Merge branch 'odin-lang:master' into fix-forwarded-poly-proc-param 2026-09-28 09:35:20 -04:00
Louis Novy fc8b49f5f5 Fix the same $ procedure argument generating duplicate instantiations 2026-09-27 10:40:33 -04:00
gingerBill 9924dcebd3 Merge pull request #7629 from Dreamshade-1911/fix/proc-lit-union-variant-compound-lit
Fix #7596 and #7511
2026-09-27 15:01:39 +01:00
Louis Novy d65d743ab7 Fix full length swizzles through a pointer keeping the pointer type 2026-09-26 22:22:42 -04:00
Louis Novy 13988d863a Fix forwarded $ procedure parameters reusing the first instantiation 2026-09-26 22:14:37 -04:00
Louis Novy 9453e0e75e Fix broadcasting arrays of matrices and matrices 2026-09-26 19:39:53 -04:00
corleypc 223e8d921c Merge branch 'master' into lifetime-markers 2026-09-26 13:34:40 +03:00
Ihor Antonov 0aee554caa core/crypto/_fiat/field_p256r1: fix fe_sqrt addition chain base
Step 4 (t0 = x^0xc) passed x^1 (&xx) instead of x^3 (out1), producing
an incorrect exponent and rejecting valid quadratic residues. This broke
compressed SEC1 P-256 point decoding via pt_set_sec_bytes.
2026-09-25 13:49:23 -07:00
Jeroen van Rijn 413a634cef Merge pull request #7633 from JackMordaunt/json-unquote-invalid-utf8
core/encoding/json: size the unquote buffer for replaced invalid UTF-8
2026-09-25 11:22:40 -07:00
Jack Mordaunt 641844dae7 core/encoding/json: size the unquote buffer for replaced invalid UTF-8
unquote_string replaces each byte that is not valid UTF-8 with U+FFFD,
which is three bytes for one, but sized its buffer as len(s) + 2*UTF_MAX:
slack for a single replacement, not for one per invalid byte. A string
holding several ran the write cursor past the end, an out-of-range slice
under bounds checking and a memory-safety bug without it.

Count the invalid bytes in the remainder up front and size for them. The
escape sequences never grow their input, so they need no allowance.
2026-09-25 14:27:40 -03:00
Fernando Nunes a5e80c7530 fix(checker): record instantiated poly proc on selector when used as a proc value 2026-09-25 07:45:33 -03:00
Fernando Nunes bc68304497 fix #7596 and #7511: proc literal as union variant in compound literal crashes backend 2026-09-25 07:08:01 -03:00
Matthias Huerbe 9f9d7f7f55 ported Eisel-Lemire's fast float algorithm to odin
also fixed string the float conversion producing wrong results.
2026-09-25 11:55:36 +02:00
Louis Novy 45b8f63960 rat_mul_rat: fix squaring path writing the denominator into the numerator 2026-09-24 09:11:20 -04:00
Matthias Huerbe 50ca03440d added a hexadecimal floating-point parsing test 2026-09-24 10:08:44 +00:00
gingerBill f43ecc4210 Merge branch 'master' into lifetime-markers 2026-09-22 22:41:06 +01:00
gingerBill 5335810e1d Merge branch 'master' into fix-7547 2026-09-22 22:37:56 +01:00
Michael Lehenauer 39d00f6ee4 Fix Windows AMD64 no-CRT stack probe support 2026-09-22 20:32:58 +02:00
jack gleeson f9ea2407b8 Add tests for fastint widths - essentially just asserts but helpful for regression 2026-09-21 11:40:51 -06:00
bplu4t2f 36c1173df6 Fix #7547 2026-09-21 17:52:49 +02:00
alyekypo 23cc994255 fix(checker): keep entity iteration valid across a scope map rehash
`check_scope_decls` iterates a scope's entity map while
`check_entity_decl` can insert into that same scope: a procedure alias
(`f :: e`) goes through `override_entity_in_scope`, which calls
`scope_map_insert`. The map grows at 75% load (12 of 16 slots, then 24
of 32), and `scope_map_insert` grows before it probes for the key, so
even an alias that only replaces an existing value rehashes and
reallocates the table in the middle of the iteration.

`ScopeMapIterator` re-read its map on every step while `end` had
captured the capacity at loop start, so the walk continued over the new
table under the old sentinel: it ran past the end of the reallocated
table and dereferenced whatever followed it as an `Entity *` - a nullptr
dereference for a procedure scope holding exactly 12 or 24 entities - or
it stopped at the stale end index and silently skipped every declaration
that the rehash had moved behind it, which left unused declarations
without any diagnostic at all.

The iterator now snapshots the table pointer and capacity when it is
constructed, so iteration is invariant under any insert or grow and
cannot leave the table it began on. A scope that does not grow behaves
exactly as before: the snapshot points at the same table.

Refs #7598
2026-09-21 13:13:39 +00:00
corley bac6130710 lifetime markers for named locals 2026-09-20 15:55:26 +03:00
Jeroen van Rijn b2354a04b9 Merge pull request #7536 from tGautot/ftr/core_odin_triple_quote
Fix #7526 : Handle triple quote/tick string in odin/core
2026-09-20 04:19:54 -07:00
bplu4t2f 7f546546f7 Fix missing comma before newline 2026-09-19 12:43:24 +02:00
Senthilnathan 699973abd6 Merge branch 'master' into fix/location-global-initializer 2026-09-16 18:45:52 +05:30
Senthilnathan ed2d5304d1 fix: #location in global variable initializers 2026-09-16 18:42:10 +05:30