Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9fccc47
Several leaks and bugs fixed (added new unit test)
marcobambini Jan 24, 2026
633aa73
Update README.md
marcobambini Jan 24, 2026
f82bd06
Update index.html
marcobambini Jan 30, 2026
76b3d7b
fix clang build
iAndyHD3 Jan 30, 2026
f01f46c
Merge pull request #435 from iAndyHD3/master
marcobambini Feb 2, 2026
bb850e8
Bump version to 0.9.5 — extensive bug fixes, memory safety improvemen…
marcobambini Feb 23, 2026
38b2a57
Update README.md
marcobambini Feb 24, 2026
0e42cb8
Update ARCHITECTURE.md
marcobambini Feb 24, 2026
dd81589
fix(core): move gravity_opt_free after refcount check to prevent doub…
barchett Feb 19, 2026
87c9c90
Merge pull request #436 from barchett/fix/double-free-gravity-opt-free
marcobambini Apr 1, 2026
18b9195
Bump version to 0.9.6 — OOM safety, init-chain fix, docs, and test su…
marcobambini Apr 14, 2026
93930ac
Mark 0.9.6 as released in CHANGELOG
marcobambini Apr 14, 2026
914793a
Fix float precision loss in JSON serialization and cpool deduplicatio…
marcobambini Apr 14, 2026
26720f5
Fix gravity_optionals.h always defining all optional module guards (i…
marcobambini Apr 14, 2026
f75af89
Fix Makefile dependency errors (issue #413)
marcobambini Apr 14, 2026
c66b690
Bump version to 0.9.7 — bug fixes for float precision, optional modul…
marcobambini Apr 14, 2026
aa18dbc
Change install instructions to be more readily packagable.
eigenwhat May 25, 2026
53bdbf7
Add self to CONTRIBUTORS.
eigenwhat May 25, 2026
9827138
Merge pull request #439 from eigenwhat/cmake-changes-for-packaging
marcobambini May 26, 2026
eb67d22
fix: V-001 security vulnerability
orbisai0security May 26, 2026
3744550
Merge pull request #440 from orbisai0security/fix-console-strcat-buff…
marcobambini May 26, 2026
91ab40b
fix: computed properties leaked by double macro expansion in gravity_…
barchett Jul 19, 2026
380aa4d
fix: gray-list buffer orphaned by marray_init ordering in gravity_vm_new
barchett Jul 19, 2026
17a280b
Merge pull request #445 from barchett/fix/vm-memory-leaks
marcobambini Jul 20, 2026
1b9bbf3
fix: heap out-of-bounds read in parse_number_expression (#446)
marcobambini Aug 5, 2026
e1f38c2
Merge pull request #449 from marcobambini/fix/parser-number-oob-read
marcobambini Aug 5, 2026
97b92c2
fix: optional classes never released due to unbalanced refcount
marcobambini Aug 5, 2026
9b337c3
fix: harden the JSON executable loader and scanner (#444, #447, #448)
marcobambini Aug 5, 2026
6330961
fix: core reference leaked by every gravity_compiler_run
marcobambini Aug 5, 2026
bfc9f49
fix: Int overflow and float remainder constant folding (#443)
marcobambini Aug 5, 2026
2d228e0
Merge branch 'fix/loadbuffer-json-hardening'
marcobambini Aug 5, 2026
899b577
Merge branch 'fix/const-folding-rem-and-int-overflow'
marcobambini Aug 5, 2026
64cf047
Merge branch 'fix/optionals-refcount'
marcobambini Aug 5, 2026
573f2a8
Merge branch 'claude/xenodochial-brahmagupta-7367f6'
marcobambini Aug 5, 2026
60d759c
ci: add a GitHub Actions build, test and sanitizer workflow
marcobambini Aug 5, 2026
6cbf589
fix: double free of the inline source buffer in the CLI
marcobambini Aug 5, 2026
1236a3c
docs: correct the default bytecode output file name
marcobambini Aug 5, 2026
970757d
Bump version to 0.9.8 — memory safety and JSON loader hardening
marcobambini Aug 5, 2026
3cf4876
fix: mirror the runtime float precision when folding a remainder
marcobambini Aug 5, 2026
6e8d00e
fix: heap buffer overflow in list_storeat when the resize fails
marcobambini Aug 5, 2026
94ba228
ci: remove the CodeQL workflow, let the compiler check formats instead
marcobambini Aug 5, 2026
daefac8
fix: count a CR+LF pair as a single line break in the lexer
marcobambini Aug 5, 2026
a8ea371
build: add a staticlib target to the Makefile
marcobambini Aug 5, 2026
40a26f2
fix: guard the Windows code paths with _WIN32, not WIN32
marcobambini Aug 5, 2026
f5d7abb
Merge Gravity 0.9.8 and harden Swift bridge
SpectralDragon Aug 26, 2026
ff0bf65
Update SwiftSyntax for Swift 6.2
SpectralDragon Aug 26, 2026
c0f827a
Fix bridged instance cleanup during VM teardown
SpectralDragon Aug 26, 2026
0c23982
Pass existing Gravity values through bridge methods
SpectralDragon Aug 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
*.gravity linguist-language=swift
*.gravity linguist-vendored

# this test is about how CR+LF line endings are counted, so it has to reach the
# working directory byte for byte, whatever core.autocrlf is set to
test/unittest/bugfix_crlf_lineno.gravity -text
104 changes: 104 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: "Build and test"

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
name: ${{ matrix.os }} / ${{ matrix.cc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
cc: [gcc, clang]

steps:
- uses: actions/checkout@v4

- name: Build
run: make CC=${{ matrix.cc }}

# run_all.sh runs each file in its own process and only catches crashes and
# timeouts, while -t checks the result declared in every #unittest block
- name: Unit tests
run: test/unittest/run_all.sh

- name: Unit test assertions
run: ./gravity -t test/unittest

- name: JSON executable loader tests
run: test/loadbuffer/run_all.sh

sanitizers:
name: address + undefined sanitizer
runs-on: ubuntu-latest
env:
# CC is used to both compile and link, so the sanitizer flags belong here
SAN_CC: "clang -fsanitize=address,undefined"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:abort_on_error=1"
# this job is about out of bounds and undefined behaviour: leak detection is
# left off so that a leak somewhere else cannot mask a memory safety report.
# abort_on_error makes a finding arrive as SIGABRT on every platform, instead of
# the plain exit code 1 the runtime defaults to on Linux, which is indistinguishable
# from an input the interpreter simply rejected.
# Some inputs in test/fuzzy ask for a list index in the 10^9 range, which is a
# single allocation of several GB and enough to push the runner into the OOM
# killer: cap one allocation and let it fail, which the interpreter reports as a
# normal runtime error. Without the cap this job dies with exit code 143
ASAN_OPTIONS: "detect_leaks=0:abort_on_error=1:allocator_may_return_null=1:max_allocation_size_mb=1024"

steps:
- uses: actions/checkout@v4

- name: Build gravity
run: make CC="$SAN_CC"

- name: Build jsontest
run: make jsontest CC="$SAN_CC"

# test/unittest/run_all.sh gives each test 0.1s, which is calibrated for an
# -O2 build and too tight once the binary is instrumented, so the unit tests
# are run here directly with a generous per test timeout
- name: Unit tests
run: |
status=0
for test in $(find test/unittest -name '*.gravity' | grep -v disabled); do
if ! timeout 60 ./gravity "$test"; then
echo "Fail! $test"
status=1
fi
done
exit $status

- name: Unit test assertions
run: ./gravity -t test/unittest

# the fuzzing corpus has no runner of its own: every input must compile and
# run without crashing, which is exactly what a sanitized build checks
- name: Fuzzing corpus
run: |
status=0
for test in $(find test/fuzzy -name '*.gravity'); do
# || keeps the failure out of set -e, which the default shell enables
res=0
out=$(timeout 60 ./gravity "$test" 2>&1) || res=$?
# a fuzzed input is allowed to be rejected, and to run out of memory, but
# never to crash and never to trip a sanitizer
if [[ $res -ge 128 ]]; then
echo "Fail! $test killed by signal $(($res-128))"
echo "$out" | head -40
status=1
elif grep -qE 'ERROR: (Address|Undefined|Leak)Sanitizer|runtime error:' <<< "$out"; then
echo "Fail! $test tripped a sanitizer"
echo "$out" | head -40
status=1
fi
done
exit $status

- name: JSON executable loader tests
run: test/loadbuffer/run_all.sh
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ paket-files/
*.x86_64
*.hex
gravity
jsontest
example

# Default output of gravity -c
gravity.g

# Debug files
*.dSYM/
Expand Down Expand Up @@ -325,6 +330,7 @@ binding/GravityObjC/GravityObjC.xcodeproj/project.xcworkspace/xcshareddata/IDEWo
gravity.xcodeproj/xcuserdata/marco.xcuserdatad/xcschemes/gravity.xcscheme
*.xcscheme
*.xcscheme

.build/
.swiftpm/
gravity.xcodeproj/xcuserdata/marco.xcuserdatad/xcschemes/gravity.xcscheme
*.d
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ compiler:
script:
- make
- test/unittest/run_all.sh
- ./gravity -t test/unittest
- test/loadbuffer/run_all.sh
Loading
Loading