Skip to content

plx 1.3.1

Latest

Choose a tag to compare

@jdatcmd jdatcmd released this 16 Jul 23:08

Code-only patch release (no catalog changes) carrying the memory-safety and robustness fixes from the full-repo transpiler audit (#1). Upgrade with ALTER EXTENSION plx UPDATE TO '1.3.1' after installing the new module.

Fixed

  • Missing capacity guard on the trailing T_EOF token write in lex() (heap overflow / SIGSEGV when a source lexed to exactly cap-1 tokens).
  • plx_strbuild sb_ensure() int32 doubling could wrap negative near ~1GB and spin while passing a bogus size to repalloc; growth is now 64-bit and clamped to MaxAllocSize.
  • The recursion-guarded transpiler entries now call check_stack_depth(), so deeply nested input raises a clean error (honoring max_stack_depth) instead of crashing the backend.
  • The Python lexer raises a clean "indentation nested too deeply" error at the indent-stack limit instead of emitting an unbalanced T_INDENT.
  • Raw single-quoted strings in Ruby and PHP keep backslashes literal (only \\ and \' are special).
  • PHP ${name} curly interpolation in double-quoted strings is now recognized.
  • Non-decimal integer literals (0x/0o/0b, with _ separators) are lexed as one token and rewritten to decimal (portable to PG13-15); a >64-bit literal raises a clean "integer literal out of range" error.

Other

  • Declare the built-in dialect descriptors in plx.h, clearing -Wmissing-variable-declarations.

Verified against PostgreSQL 18.4: clean build, all 13 installcheck tests pass, and the 1.3.0 → 1.3.1 upgrade applies cleanly.