aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Convert mutex guard to "try lock"gingerBill2024-11-261-7/+9
| | |
* | | Fix #4508 for abs, min, max (#4516)Jeroen van Rijn2024-11-251-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix #4508 for abs, min, max and the rest of the builtins. None of these segfault now: ```odin package bug main :: proc() { p :: proc() {} // _ = len(p()) // _ = cap(p()) // _ = size_of(p()) // _ = align_of(p()) // T :: struct {} // _ = offset_of(p()) // _ = offset_of(T, p()) // _ = offset_of(p(), foo) // _ = offset_of(p(), "") // _ = type_of(p()) // _ = type_info_of(p()) // _ = typeid_of(p()) // A: [4]int // _ = swizzle(p()) // :: proc(x: [N]T, indices: ..int) -> [len(indices)]T --- // _ = swizzle(A, p()) // :: proc(x: [N]T, indices: ..int) -> [len(indices)]T --- // _ = complex(p(), p()) // _ = quaternion(p(), p(), p(), p()) // _ = quaternion(w=p(), x=p(), y=p(), z=p()) // _ = real(p()) // _ = imag(p()) // _ = jmag(p()) // _ = kmag(p()) // _ = conj(p()) // _ = expand_values(p()) // _ = min(p()) // _ = max(p()) // _ = abs(p()) // _ = clamp(p(), p(), p()) // _ = soa_zip(p()) // _ = soa_unzip(p()) } ```
* | | Allow for `odin help build` etcgingerBill2024-11-251-1/+7
| | |
* | | checker: only error with -vet-cast when it is actually castableLaytan Laats2024-11-211-1/+4
| | |
* | | Improve `odin help -foo` usagegingerBill2024-11-181-351/+380
| | |
* | | report error when builtin min/max has 1 (non-type) paramjakubtomsu2024-11-171-0/+9
| |/ |/|
* | add missing macos versionLaytan Laats2024-11-161-0/+15
| |
* | Make lowercasegingerBill2024-11-141-1/+1
| |
* | Fix typogingerBill2024-11-141-1/+1
| |
* | Add `-linker:<string>` to replace `-lld` and `-radlink`gingerBill2024-11-143-20/+70
| |
* | Disallow `-lld` and `-radlink` to be used togethergingerBill2024-11-141-0/+8
| |
* | Add `-radlink`gingerBill2024-11-143-21/+52
| |
* | Remove `#relative` types from the compilergingerBill2024-11-1412-463/+4
| |
* | Make `#relative` types an error in parsinggingerBill2024-11-141-0/+1
| |
* | Keep ASAN happy on type assertionsgingerBill2024-11-131-2/+10
| |
* | Added support for `odin build -target:?`bayo-code2024-11-111-21/+23
| |
* | Revert "List the supported targets using `odin targets`"bayo-code2024-11-111-7/+0
| | | | | | | | This reverts commit b589e3c499649aa956a9ebf98ae2aca260156471.
* | List the supported targets using `odin targets`bayo-code2024-11-101-0/+7
| |
* | Remove duplicates in `-defineables`gingerBill2024-11-081-2/+16
| |
* | &&Jeroen van Rijn2024-11-071-1/+1
| |
* | Phrasing!Jeroen van Rijn2024-11-071-2/+2
| |
* | Suggest `-microarch:native` if `popcnt` instruction is missing.Jeroen van Rijn2024-11-074-21/+49
| | | | | | | | Fixes #4453.
* | Merge pull request #4394 from seventh-chord/errormessagesgingerBill2024-11-061-0/+9
|\ \ | | | | | | Suggestion when assigning enum to bit_set
| * | Suggestion when assigning enum to bit_setMorten Hauke Solvang2024-10-191-0/+9
| | |
* | | Merge pull request #4437 from dpoetzschke/fix/windows-args-escapinggingerBill2024-11-061-0/+30
|\ \ \ | | | | | | | | fix windows args parser problem from issue #4393
| * | | added bracesDominik Pötzschke2024-10-311-2/+4
| | | |
| * | | adjust memory allocationDominik Pötzschke2024-10-301-1/+6
| | | |
| * | | fix: fix windows params bugDominik Pötzschke2024-10-301-0/+23
| | | |
* | | | 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.