Commit Graph
830 Commits
Author SHA1 Message Date
bplu4t2f 3e1c4033af download_assets.py now at least prints something so that we know what is happening 2026-10-10 11:49:43 +02:00
bplu4t2f b17c76e5a4 !!WIP!! Merge branch 'master' into speedup-ci - missing tests/issues/run.bat and run.sh changes 2026-10-09 20:56:04 +02:00
bplu4t2f f5c9785d79 XML test: Log level to debug 2026-10-09 16:27:44 +02:00
bplu4t2f 115e239abd test_verify_signature_tamper_sweep: Divide CPU intensive test so that the test runner can at least multithread it. 2026-10-09 16:18:13 +02:00
bplu4t2f 18d3de890c XML hot path: Cleanup 2026-10-09 14:34:02 +02:00
bplu4t2f cde71cdfc0 XML hot path: Cleanup instrumentation 2026-10-09 14:18:27 +02:00
gingerBill 300f980e1c Merge pull request #7832 from aakamenov/text-edit-translation-fix-1
text/edit: fix "word right" translation
2026-10-09 10:55:21 +01:00
aakamenov b7976863c1 Fix test_translate_by_word 2026-10-09 12:23:28 +03:00
bplu4t2f 40b68a7102 Experimental hot path optimization in XML test. 2026-10-08 23:09:37 +02:00
BBandClaude Opus 5.5 e016974a2e Lower 64-bit fixed_point_div with 128-bit division
LLVM legalizes a 64-bit sdiv.fix or udiv.fix whose dividend does not
fit by widening it to a 128-bit division with remainder, for which no
target has a library call, so code such as fixed_point_div(x, y, 63)
on i64 aborted with "unsupported library call operation".

64-bit fixed point division is now built from plain 128-bit division
and remainder, which lower to __divti3 and friends, rounding down and
saturating as LLVM's expansion does. Results for the scales LLVM could
already handle are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 22:12:45 +02:00
BBandClaude Opus 5.5 baca00868b Pass va_list by value to libc's v* functions
C passes a va_list argument by value. The bindings took ^va_list, which
only matches x86-64 System V, where va_list is an array that decays to
a pointer. On Darwin, Windows and the other targets va_list is a
pointer or a struct, so vsnprintf and friends received the address of
the list instead of the list and printed or scanned garbage.

The foreign declarations now use the platform's form, and the public
procedures keep taking ^va_list so callers stay portable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 22:10:02 +02:00
Jeroen van Rijn a961bb5ddb Merge pull request #7818 from bbodi/fix/sha3-init-round-start
Reset keccak_round_start in _sha3.init
2026-10-08 02:51:19 -07:00
bbodi f7f3e63191 Reset keccak_round_start in _sha3.init
init left the round start untouched. A context that skipped zeroing
with `= ---`, or one reused after TurboSHAKE, kept a stale value, so
SHA-3 and SHAKE ran too few rounds and returned wrong hashes silently.
2026-10-08 11:02:47 +02:00
Jeroen van Rijn 4d09219ff4 Merge pull request #7616 from wardjm/fix/parse_int_overflow
Fixed strconv overflow noted in issue#7608.
2026-10-08 01:57:40 -07:00
Jeffrey Ward c2684b43cb Added tests from issue 7608 comments.
Fixed "_" only and no digits. Now returns an error since this is effectively passing nothing to the parser.
2026-10-07 21:28:43 -04:00
gingerBill 711f08a641 Make is_type_lock_free follow what each target lowers without library calls, and reject atomics on types which are not lock-free 2026-10-07 21:58:32 +01:00
gingerBill c713bede2f Stop core and tests leaving references to stack memory behind 2026-10-07 15:49:33 +01:00
gingerBill 4957867890 Update test_core_runtime.odin 2026-10-04 19:16:24 +01:00
gingerBill f05c574cae Merge pull request #7520 from Pippoosh/fix-soa-pointer-using-field
Fix #soa pointer field access through using
2026-10-04 19:01:28 +01:00
gingerBill 18aead3ba1 Merge pull request #7729 from odin-lang/bill/llvm-backend-improvements
LLVM Backend Performance Improvements to Reduce Compile Times Part 2
2026-10-04 19:01:11 +01:00
Jeroen van Rijn 667efeb840 Merge pull request #7731 from Arthur031221/fix/timezone-utc-nanoseconds-20261004-s29
Preserve fractional timestamps in timezone conversions
2026-10-04 05:24:55 -07:00
gingerBill b079c1a23b Merge pull request #7672 from MatzeOGH/fast_float_swar_parse
Second Part of the Fast Float Port (SWAR based scanning)
2026-10-03 22:31:02 +01:00
Arthur031221anddozn d046345202 Preserve fractional timestamps in timezone conversions
Apply timezone offsets to the normalized nanosecond timestamp.
Test fractional roundtrips, dates before 1970 and nanosecond carry.

Co-authored-by: dozn <16659513+dozn@users.noreply.github.com>
Signed-off-by: Arthur031221 <levi74108520963@gmail.com>
2026-10-04 03:39:11 +08:00
gingerBill fcab1c1887 Merge remote-tracking branch 'remotes/Odin-GitHub/master' into bill/llvm-backend-improvements 2026-10-03 15:29:46 +01:00
gingerBill ecfd651f95 Use atomics for the flags name_test 2026-10-03 15:26:49 +01:00
Artur Leite d8a598b1a3 Accept .Recv channels in chan.recv and chan.try_recv 2026-10-03 13:01:17 +02:00
Arthur031221 eaa1cb34eb Fix CBOR bit set byte order conversion 2026-10-02 18:57:49 +08:00
Arthur031221 f01284d372 [core:encoding/csv] Read the final multiline record before EOF
The multiline line reader returned EOF with buffered data, so record
parsing discarded the last row when the file had no trailing newline.
Clear EOF while data remains, as the normal line reader does.

Add regressions for final records, empty input and unterminated quotes.
The normal core suite passes 627 tests with the new CSV tests included.
2026-10-02 14:10:58 +08:00
Ihor Antonov a5bef5224c core: add unpadded base64 encoding
core:encoding/base64 can only produce padded output, so callers that need
the canonical unpadded ("raw") form -- JOSE base64url, Go's
RawStdEncoding/RawURLEncoding -- have to encode and then trim, which
forces an extra allocation and cleanup dance around the returned string.

Add an Encode_Options bit set, mirroring Decode_Options, and honor
{.No_Padding} in `encode`, `encode_into_buf`, `encode_into`, and
`encoded_len`. Existing calls and padded output are unchanged.

Tests cover the RFC 4648 section 9 illustrations and section 10 test
vectors across the standard and URL alphabets, padded and raw, plus Go's
reference corpus. Newline characters are asserted to be rejected per
RFC 4648 section 3.3. Comments in `encode_impl` document the 24-bit group
packing and the padding decision for partial groups.
2026-09-30 19:53:10 -07:00
gingerBill b6f29d5f5d Merge branch 'master' into fix/parse_int_overflow 2026-09-30 12:29:32 +01:00
Matthias Huerbe dad90e2850 added unit tests for string to float conversion 2026-09-29 20:43:14 +02: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 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
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
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
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
Jeffrey Ward 4e724f13c2 Fixed strconv overflow noted in issue#7608. Added regression tests to catch failing conditions and test edge conditions. 2026-09-22 17:19:45 -04: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 7f546546f7 Fix missing comma before newline 2026-09-19 12:43:24 +02:00
Tom Gautot e43040d371 Add core/odin parsing test checking both triple quote and triple tick strings 2026-09-10 21:55:28 +02:00
Kriday Kini 4839f20da9 Fix #soa pointer field access through using (#7513).
lb_emit_deep_field_gep treated an #soa pointer as a one-shot field grab and never updated the current type, so using paths with extra selection indices ICE'd.
2026-09-06 10:00:30 +05:30
BlackHole00 0672a7c683 Implement tests for the mem.Scratch allocator
Checks that the backing memory of the scratch
allocator gets reused upon memory depletion.
Checks that the backing allocator only gets used
when allocations bigger than the backing memory are
requested.
2026-09-05 00:42:38 +02: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
thetarnav db2f88cff9 Improve parsing field docs and comments (fixes #5353) 2026-08-29 19:22:18 +02:00
Jeroen van Rijn 9909676141 Merge pull request #7462 from MoonlightChase/fix-grapheme-width
This Fixes #5939 , where many characters like flags are reported with…
2026-08-26 06:14:30 -07:00