Skip to content

Z Compiler v0.13.0

Latest

Choose a tag to compare

@Prime-Lasking Prime-Lasking released this 14 Apr 00:39
· 2 commits to main since this release

Bug Fixes

High Priority

  1. Closure Bug in Handler Creation

    • Fixed late binding issue in semantics.py handler creation
    • Use default argument to properly capture loop variable values
  2. Redundant Dead Code

    • Removed unreachable code in main.py run_after_compile check
  3. Incomplete Type Mapping

    • Added missing print_double function for float/double types
    • Ensures proper printing of floating-point values
  4. Incorrect Operand Indexing

    • Fixed constant propagation to check correct operand index
    • Value is now correctly identified as last operand in LET instructions
  5. Flawed Dead Code Elimination

    • Improved dead code elimination to properly track variable usage
    • Now distinguishes between reads and writes for accurate analysis

Medium Priority

  1. Incorrect ELSE Detection

    • Fixed lexer to use word boundary regex for ELSE: detection
    • Prevents incorrect matching of patterns like ELSE:IF
  2. Missing Handler Entries

    • Removed non-existent handler entries from HANDLERS dictionary
    • Cleaned up WHILE, FOR, CONST, READ, and ERROR mappings
  3. Inconsistent Array Type Mapping

    • Changed Astring mapping from char* to const char* for consistency
    • Aligns with string handling throughout the codebase
  4. Potential Integer Overflow

    • Fixed overflow check to use proper type casting
    • Result now explicitly cast to int after overflow check
  5. Memory Leak in array_free

    • Added NULL check before freeing string elements
    • Prevents undefined behavior from freeing NULL pointers

Low Priority

  1. Redundant Import Check
    • Removed redundant IMPORT handling in codegen.py
    • Cleaned up dead code that performed no useful operation

Code Quality

  • Removed BUGS.md after fixing all documented issues
  • Improved code reliability and safety across all modules
  • Enhanced type consistency and memory management

Breaking Changes

None. This release maintains backward compatibility.

Migration Guide

No migration required. Existing Zlang code continues to work without changes.