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_EOFtoken write inlex()(heap overflow / SIGSEGV when a source lexed to exactlycap-1tokens). plx_strbuildsb_ensure()int32doubling could wrap negative near ~1GB and spin while passing a bogus size torepalloc; growth is now 64-bit and clamped toMaxAllocSize.- The recursion-guarded transpiler entries now call
check_stack_depth(), so deeply nested input raises a clean error (honoringmax_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.