Commit Graph
8369 Commits
Author SHA1 Message Date
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 ad8e0042d4 Merge pull request #6722 from yosinn1-blip/codex/typo-6679-microsecond-time-val
docs: fix Time_Val precision comment
2026-09-25 13:04:24 -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
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 7fc688e651 cleanup 2026-09-24 10:57:59 +00:00
Matthias Huerbe d49b4e65a7 fixed hex parsing of floats 2026-09-24 10:15:51 +00:00
macsmol a903fe2d04 Explanation to dynlib example 2026-09-24 10:02:36 +02:00
Alexander Zhura e493449c90 Impl simd arm neon zip unzip extract set3 2026-09-20 20:47:24 +03:00
Alexander Zhura c975678004 Impl simd arm neon zip unzip extract set2 2026-09-20 20:43:31 +03:00
Alexander Zhura 945b5980d9 Impl simd arm neon zip unzip extract set1 2026-09-20 20:32:29 +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
Tom Gautot 608d6c0054 Proper Odin semicolon-less syntax 2026-09-20 11:24:36 +02:00
Yawning Angel 389dd7d925 core/os/env_linux: Fix the 0th env var being duplicated 2026-09-20 08:35:02 +09:00
gingerBill d26833285c Merge pull request #7565 from Einh06/master
sys/windows: Add performance counter PSAPI bindings
2026-09-16 13:50:31 +01:00
gingerBill cfeda7c3dd Merge pull request #7563 from alexthed1rk/impl-simd-arm-neon-shift-right
Impl simd arm neon shift right
2026-09-16 12:57:02 +01:00
Florian Morel 291159a431 psapi binding improvements 2026-09-15 06:48:07 +02:00
Jeroen van Rijn 6d23dd8367 Add macOS 27 to Where to find more information and get into contact when you encounter a bug:
Website: https://odin-lang.org
	GitHub:  https://github.com/odin-lang/Odin/issues

Useful information to add to a bug report:

	Odin:    dev-2026-09:315725197
	OS:      macOS Golden Gate 27.0.0 (build 26A428, kernel 27.0.0)
	CPU:     Apple M4 Pro
	RAM:     24576 MiB
	Backend: LLVM 22.1.8
2026-09-14 23:07:17 +02:00
Alexander Zhura a4d997740a Impl simd arm neon shift right 2026-09-14 19:28:08 +03:00
Tom Gautot ba59817eac Align tokenizer logic between core/odin and compiler for triple quoted strings 2026-09-12 17:49:50 +02:00
Tom Gautot 4ec5cae7e7 Handle triple quote/tick in core/odin 2026-09-10 21:55:06 +02:00
NicknEma 1e07cf39b3 Add line-drawing functions in gdi32.odin 2026-09-10 11:03:07 +02:00
gingerBill 8b5e8a17d0 Merge pull request #7527 from henrik-the-creator/Fix-avx-_mm256_permute2f128_si256-compiler-error
Fixed typo in avx.odin
2026-09-08 19:15:10 +01:00
gingerBill d33de63d3e Merge pull request #6787 from BigBoyBarney/documentation_fmt_os
Improved fmt_os documentation
2026-09-08 19:14:51 +01:00
henrik-the-creator 47449e3abc Fixed typo in avx.odin
simd_shuffle only wants constants in the shuffle indices so using this proc would generate a compiler error before this change.
2026-09-08 11:12:21 -07:00
gingerBill b703f33d22 asm: Give good error message when trying to use condition code identifiers that are not defined, even giving hints as to what you should define them as. 2026-09-08 10:37:29 +01:00
gingerBill 0c4173a5e9 Update the cpp-gen.odin for arm64 2026-09-08 10:13:49 +01:00
gingerBill 94aba2bd6b Support #reserve for asm registers 2026-09-07 14:43:58 +01:00
gingerBill 773383879a Fix #7521 - check for target feature for parameters not being enabled and then labelled correctly 2026-09-07 13:04:41 +01:00
gingerBill 6455ea5535 Correctly handle dealing with in and out mnemonics which have loads of implicit operands 2026-09-07 12:50:20 +01:00
gingerBill 3f873d656c Check for non allocateable registers and disallow them to be pinned to output parameters 2026-09-07 12:26:38 +01:00
Jeroen van Rijn 45b545e075 Merge pull request #7489 from alexthed1rk/impl-simd-arm-neon-shift-left
Impl simd arm neon shift left
2026-09-06 08:12:09 -07:00
Alexander Zhura f41f28e8b2 Impl simd arm neon shift right, rounding and accumulate 2026-09-06 17:59:13 +03:00
Alexander Zhura 0f47a87d59 Impl comptime uint32_t to int32_t cleanup 2026-09-05 13:33:56 +03:00
Jeroen van Rijn 0251becedb Revert #6476
PR #6476 "fixed" an issue that didn't exist because it misunderstood this allocator's semantics. What it conluded was an edge case was in fact entirely predictable and desireable behavior for this allocator.

In "fixing" this edge case, it prevented the exact scratch mechanics that sets this allocator apart for its use case.

Reverted.
2026-09-04 23:23:26 +02:00
Jeroen van Rijn 16ba9e964c Apply mojibake magic to test runner, too. 2026-09-02 15:25:40 +02:00
gingerBill b969878bdf Fix needed calculation in arena_alloc_unguarded 2026-09-02 13:03:06 +01:00
gingerBill b245c44036 Fix total_size calculation for memory_block_alloc 2026-09-02 13:02:38 +01:00
gingerBill 2f3baf40c0 Fix alignment issues with Small_Stack 2026-09-02 13:01:58 +01:00
Alexander Zhura 3ee25c45d2 Impl simd arm neon shift left and insert 2026-09-02 14:03:18 +03:00
Stanislav Ch. Nikolov 426b015e3c sys/windows: Add missing optional comma in PointerFlag enum 2026-09-02 00:13:43 +03:00
Stanislav Ch. Nikolov 81742df9be core:sys/windows fix in_rage typo and spaces instead of tabs 2026-09-02 00:06:17 +03:00
Stanislav Ch. Nikolov 9a5beb0164 Merge branch 'win32-pen' 2026-09-01 22:44:41 +03:00
Stanislav Ch. Nikolov ce37a83df3 Add support for advanced pen & pointer win32 functions 2026-09-01 22:42:25 +03:00
Alexander Zhura 807b33d4b0 Impl simd arm neon shift left and widen 2026-09-01 21:14:11 +03:00
Alexander Zhura a170f48381 Impl simd arm neon shift left 2026-09-01 16:24:56 +03:00
gingerBill 9a425de2ae Merge pull request #7465 from odin-lang/bill/arm64-clobber
asm: arm64 support
2026-09-01 10:22:08 +01:00
gingerBill 3c46e132e0 Keep -vet happy 2026-09-01 09:33:08 +01:00
user.name 6ccde7f80b bugfix: core/encoding/json leaks the key and value of a malformed object
parse_object_body allocates an object key, then may fail in parse_colon or
parse_value before that key is ever inserted into the object. Its cleanup defer
only walks `obj`, so a key that never got there is unreachable to it. The caller
cannot free it either -- a failed parse returns a nil Value -- so it leaks.

The same applies to the parsed element on the duplicate-key path, and to both on
the out-of-memory path.

JSON5 makes this reachable from ordinary malformed input, because an unquoted
ident is a legal key and anything other than a colon after it fails. Plain JSON
leaks it too, via a quoted key.

before, measured with a tracking allocator over 8 inputs x 2 specs:

	LEAK JSON5  colon fails after unquoted key   1 alloc / 7 bytes
	LEAK JSON   colon fails after quoted key     1 alloc / 2 bytes
	LEAK JSON5  colon fails after quoted key     1 alloc / 2 bytes
	LEAK JSON   value fails after key            1 alloc / 2 bytes
	LEAK JSON5  value fails after key            1 alloc / 2 bytes
	LEAK JSON   nested value fails               2 alloc / 4 bytes
	LEAK JSON5  nested value fails               2 alloc / 4 bytes
	LEAK JSON   deep nesting fails               3 alloc / 6 bytes
	LEAK JSON5  deep nesting fails               3 alloc / 6 bytes
	LEAK JSON   array element fails              1 alloc / 2 bytes
	LEAK JSON5  array element fails              1 alloc / 2 bytes
	total leaked allocations: 17

after, same probe:

	total leaked allocations: 0

The leak scales with nesting depth -- one orphaned key per enclosing object -- so
a service parsing untrusted JSON leaks a little on every malformed request.

The fix marks the key and the element as owned by the loop iteration until they
are stored, and frees them otherwise. The duplicate-key path loses its explicit
delete, which the same mechanism now covers.

Found via odinfmt, which reported a 7-byte leak in a downstream test that parses
`{ broken not json` to check that invalid input is rejected.

Regression test added to tests/core/encoding/json: it reports
`17 leaks and 0 bad frees` without this change and passes with it. The existing
11 tests pass unchanged under -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true.
2026-08-31 11:39:42 -07:00
gingerBill 8181e3564f Add asm syntax to core:odin/parser 2026-08-31 19:17:21 +01:00