Skip to content

Releases: marcobambini/gravity

Gravity v0.9.7

14 Apr 13:04

Choose a tag to compare

Gravity v0.9.6

14 Apr 12:06

Choose a tag to compare

What's Changed

  • fix(core): move gravity_opt_free after refcount check to prevent double-free by @barchett in #436

New Contributors

Full Changelog: v0.9.5...0.9.6

Gravity v0.9.5

23 Feb 12:25

Choose a tag to compare

Gravity v0.9.5

Extensive bug fixes, memory safety improvements, and new documentation.

Compiler

  • Fix off-by-one in lexer PEEK_NEXT/PEEK_NEXT2 boundary checks
  • Fix memory leaks in parser (parse_file_expression, parse_variable_declaration, string interpolation)
  • Fix wrong constant in semacheck2 upvalue limit error message
  • Fix wrong variable name in for-loop register allocation in codegen
  • Fix multiple early-return paths in visit_postfix_expr leaking arrays (replaced with goto cleanup)
  • Fix register clobbering in LOCATION_CLASS_IVAR_OUTER assignment
  • Fix constant folding and NEG optimization checking/writing wrong registers
  • Fix OPCODE_SET_FOUR8bit macro missing opcode field
  • Convert IR register allocation from bool[256] to compact 32-byte bitmask
  • Remove unnecessary NOP emission for empty statements

Runtime / VM

  • Fix boolean fast-path comparison incorrectly applied to ordered comparisons (LT, GT, LEQ, GEQ) — now restricted to EQ/NEQ only
  • Fix crash in gravity_vm_setslot/gravity_vm_getslot when no frames exist
  • Fix list_iterator_next out-of-bounds read
  • Fix range_contains not handling reversed ranges
  • Fix function_exec default-arg filling using wrong index formula
  • Fix int_random truncation from gravity_int_t to int
  • Fix string_count broken partial-match logic (rewrite using string_strnstr)
  • Fix string_upper/string_lower off-by-one (iterated one byte past end)
  • Fix string_loadat UTF-8 corruption when reversing multi-byte sequences
  • Fix string_loop iterating byte-by-byte instead of by UTF-8 character
  • Fix string_iterator/string_iterator_next missing bounds checks
  • Fix fiber_abort wrong nargs check
  • Fix system_input blindly stripping last char instead of checking for newline
  • Fix convert_map2string/convert_list2string losing pointer on realloc failure
  • Fix gravity_class_grow discarding existing ivar values when growing

Optional Modules

  • Math: fix atan2f for float builds; use POW macro consistently; fix division-by-zero in logx when base=1; fix integer overflow in random; fix pointer bugs in round
  • File: fix memory leaks in buildpath and directory scan; fix wrong nargs in open; fix leaked FILE* on failure; fix crash on negative read size; fix swapped fread/fwrite arguments
  • JSON: rewrite string escaping to properly handle backslashes, quotes, and control characters
  • ENV: add Windows compatibility for environ access

Shared / Data Structures

  • Fix marray_push updating capacity before confirming realloc success
  • Fix marray_resize/marray_resize0 to check realloc result
  • Fix gravity_hash_memsize counting buckets as nodes
  • Improve float hashing precision (%f → %.17g)
  • Add overflow guard to gravity_function_cpool_add

Utilities

  • Fix buffer overflow in debug DUMP_VM macros
  • Fix memory leak in gravity_disassemble
  • Fix escape buffer too small in JSON serializer
  • Fix swapped PathCombineA arguments on Windows
  • Fix file_name_frompath returning NULL when no separator
  • Add NULL check in string_dup
  • Fix signed arithmetic in number_from_bin

CLI

  • Fix memory leaks in unittest_scan and inline execution

Documentation

  • Add comprehensive ARCHITECTURE.md covering the full compilation pipeline, VM internals, value system, garbage collector, instruction set, and embedding API
  • Update README.md with Building, Usage, and Project Structure sections; update line counts; enhance Features list

Tests

  • Add 30 new unit tests covering all major bug fixes

Official 0.9.0 release

24 Jan 08:29

Choose a tag to compare

  • Several leaks and bugs fixed
  • New unit tests added

Official 0.8.5 release

22 Jul 08:38

Choose a tag to compare

Fixed a setter issue that affects some unit tests too

Official 0.8.3 release

28 Jun 19:00

Choose a tag to compare

Fixed an issue due to the introduction of lazy loading a superclass f…

Official 0.8.2 release

05 Jun 12:41

Choose a tag to compare

Added a way to lazy loading extern superclass at runtime

Official 0.8.1 release

16 Nov 08:58

Choose a tag to compare

Minor typo fixed

Official 0.8.0 release

09 Nov 07:59

Choose a tag to compare

Improved error handling and detection