aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4449 from 0dminnimda/add-piedev-2024-11Jeroen van Rijn2024-11-042-4/+13
|\ | | | | Link as PIE for PIC by default
| * Revert further simplifiction0dminnimda2024-11-041-1/+1
| |
| * Simplify further0dminnimda2024-11-041-1/+1
| |
| * Simplify use of pie0dminnimda2024-11-043-48/+9
| |
| * Add support for linking as pie0dminnimda2024-11-043-3/+51
| |
* | Fix previous commit for arraysgingerBill2024-11-041-10/+9
| |
* | Fix bug for `foo().bar` where `foo()` is a 0-value expressiongingerBill2024-11-041-12/+16
| |
* | Fix `auto_cast` matrix buggingerBill2024-11-041-1/+12
| |
* | Add "-build-mode:dynamic" to the "odin help build" outputpeachey2k22024-11-011-0/+1
| |
* | Merge branch 'master' of https://github.com/odin-lang/OdingingerBill2024-10-309-19/+46
|\ \
| * \ Merge pull request #4425 from bobsayshilol/misc-fixesgingerBill2024-10-306-16/+27
| |\ \ | | | | | | | | Misc fixes
| | * | Plug a memory leakbobsayshilol2024-10-271-2/+0
| | | | | | | | | | | | | | | | | | | | The call to |array_make()| always allocates and since this variable was unused it lead to a leak. Simply plug it by removing it.
| | * | Add missing guards around push/pop pragmasbobsayshilol2024-10-271-3/+8
| | | | | | | | | | | | | | | | This matches all the other places where we silence Windows warnings.
| | * | Fix passing nullptr to args marked as non-nullbobsayshilol2024-10-272-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libstdc++'s |memcpy| and |memset| both state that their inputs should never be a nullptr since this matches the C spec. Some compilers act on these hints, so we shouldn't unconditionally call these as it would signal to the compiler that they can't be nullptrs. As an example, the following code will always call |do_something()| when compiled with optimisations since GCC version 4.9: ``` void clear(void *ptr, int size) { memset(ptr, 0, size); } void example(void *ptr, int size) { clear(ptr, size); if (ptr != nullptr) do_something(); } ```
| | * | Avoid undefined arithmetic shiftingbobsayshilol2024-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Avoid member access through nullptr in debugbobsayshilol2024-10-271-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If |result_count| is 0 then |results| will be a nullptr and hence the access |results->Tuple| is undefined behaviour. There's already an early return in the 0 branch so move that to be the first thing so that we can guarantee that it's not a nullptr. Note that technically we take the address of the result so it's not actually dereferencing it, however UBSan doesn't care about that.
| | * | Fix invalid union accessbobsayshilol2024-10-271-1/+1
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UBSan spotted that |src->Basic.kind| had a value outside the range of |BasicKind| due to it actually being a |Type_Pointer|. Since these are stored in a union there could be cases where the value of |kind| just so happens to be |Basic_string|, in which case the branch would have been taken when it shouldn't have been. To fix this simply check that it's a |Type_Basic| before treating it as a |Basic|.
| * | Merge pull request #4427 from laytan/posix-additionsgingerBill2024-10-301-0/+4
| |\ \ | | | | | | | | Finish sys/posix with Linux and partial Windows support & clean up other packages as a result
| | * | fix `#load_directory` including nested directoriesLaytan2024-10-281-0/+4
| | | |
| * | | match_exact_value: return when type is compoundJeroen van Rijn2024-10-291-0/+1
| | |/ | |/| | | | | | | fixes #4431
| * | Merge pull request #4416 from Yawning/fix/4413gingerBill2024-10-271-3/+14
| |\ \ | | | | | | | | src/big_int.cpp: Use square-multiply for exponentiation
| | * | src/big_int.cpp: Use square-multiply for exponentiationYawning Angel2024-10-251-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | For utterly unrealistic constant sizes, this still crashes on my system, but it crashes fast due to the OOM killer, and people using rediculously large exponents get what they deserve.
* | | | Add warning for `unsigned >= 0` like conditions in a `for` loopgingerBill2024-10-301-0/+17
|/ / /
* | | Fix bug caused due to incorrect type checking looking for `context` not ↵gingerBill2024-10-271-0/+1
| | | | | | | | | | | | defined in a context
* | | fix the typeid type kind of a typeid being set to Typeid_InvalidLaytan Laats2024-10-271-0/+2
| | |
* | | Merge pull request #4418 from laytan/check-packed-on-all-loadsgingerBill2024-10-255-26/+45
|\ \ \ | | | | | | | | check packed load and set alignment on all loads, not just lb_emit_load
| * | | check packed load and set alignment on all loads, not just lb_emit_loadLaytan Laats2024-10-255-26/+45
| |/ /
* / / quote the dsymutil argumentLaytan Laats2024-10-251-1/+1
|/ / | | | | | | Fixes #4417
* | Merge pull request #4403 from tf2spi/issue-4390-fixgingerBill2024-10-231-3/+4
|\ \ | | | | | | Fix #4390 by assigning invalid entity type
| * | Fix #4390 by assigning invalid entity typeMisomosi2024-10-201-3/+4
| |/
* | Merge pull request #4404 from tf2spi/issue-4395-fixgingerBill2024-10-231-1/+1
|\ \ | | | | | | Fixes #4395 by not assuming simd returns val
| * | Fixes #4395 by not assuming simd returns valMisomosi2024-10-201-1/+1
| |/
* | Merge pull request #4408 from Lperlind/cachegingerBill2024-10-232-55/+75
|\ \ | | | | | | cached.cpp: Improve internal cached robustness
| * | cached.cpp: Improve internal cached robustnessLucas Perlind2024-10-222-55/+75
| |/ | | | | | | | | | | | | Do not memory map files; Windows cannot write to a file that is memory mapped. Write cache after llvm building. This ensures the cache won't have a false positive if llvm fails.
* / fix erronous updating alignment of external globallaytan2024-10-221-5/+5
|/
* add macos 15.0.1 to odin report and core/sys/infoLaytan Laats2024-10-141-0/+1
|
* Fix #4373gingerBill2024-10-131-2/+8
|
* Merge branch 'master' of https://github.com/odin-lang/OdingingerBill2024-10-082-9/+4
|\
| * Merge pull request #4338 from laytan/fix-ternary-swallow-errorgingerBill2024-10-041-5/+0
| |\ | | | | | | fix not erroring on invalid ternary
| | * fix not erroring on invalid ternaryLaytan Laats2024-10-021-5/+0
| | | | | | | | | | | | | | | | | | | | | For example: `a: f32 = true ? 1 : len` would get to the back-end without errors. Fixes #1690
| * | fix quaternion64 arithLaytan Laats2024-10-021-4/+4
| | | | | | | | | | | | Fixes #4282
* | | Disable exe path testgingerBill2024-10-081-13/+13
| | |
* | | [ABI FIX] Fix 128-bit ABI issuesgingerBill2024-10-041-2/+2
|/ /
* | `a ordered` to `an ordered`gingerBill2024-10-021-7/+7
| |
* | Sort flags on `odin build -help` - #4329gingerBill2024-10-021-280/+324
| |
* | Fix #4330gingerBill2024-10-021-0/+4
| |
* | Ignore `package runtime` with using `-vet-unused-packages`gingerBill2024-10-021-0/+3
|/
* Fixed confusing (and incorrect) warningolimpiu2024-09-301-1/+1
| | | Verbose errors *is* the new default
* Change struct alignment rules for `#max_field_align`gingerBill2024-09-301-0/+8
|
* `#min_field_align` & `#max_field_align`; deprecate `#field_align` in favour ↵gingerBill2024-09-304-22/+74
| | | | of `#min_field_align`