• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

KarpelesLab / goro / 26434971110
13%

Build:
DEFAULT BRANCH: master
Ran 26 May 2026 05:54AM UTC
Jobs 1
Files 398
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 May 2026 05:53AM UTC coverage: 12.549% (+0.02%) from 12.53%
26434971110

push

github

MagicalTux
vm: fix array-compound regressions via OP_ARRAY_PRE_CHECK_LOCAL

Commit ab634827 introduced OP_ARRAY_COMPOUND_ASSIGN_LOCAL and
OP_ARRAY_INC_DEC_LOCAL but missed three AST corner cases:

 * assign_dim_op_undef — `$a[$b] += 1` on undefined $a should warn
   "Undefined variable $a" + "Deprecated null offset" + "Undefined
   array key", in that order. The native opcode evaluated the offset
   first and let arrayGet's "Trying to access array offset on null"
   replace the proper undefined-variable warning.

 * bug53432 — `$str[0] += 1` on a string should throw "Cannot use
   assign-op operators with string offsets" BEFORE the offset is
   evaluated. The native path was running arrayGet + arraySetLocal
   through the string-offset machinery instead.

 * bug70662 — when arrayGet's undefined-key warning triggers an error
   handler that creates the key, the compound write must be suppressed
   so the handler's value remains visible.

Adds OP_ARRAY_PRE_CHECK_LOCAL which runs BEFORE the offset is pushed.
It mirrors runArrayAccess.Run's ZtNull / ZtString compound-write-context
branches: warn + auto-vivify undefined containers, vivify explicit
nulls, and throw "Cannot use assign-op operators with string offsets"
for string containers. Warning order now matches the AST.

OP_ARRAY_COMPOUND_ASSIGN_LOCAL and OP_ARRAY_INC_DEC_LOCAL now also:
 * emit "Using null as an array offset is deprecated" in the read
   phase when the offset is null and the container is array/string/
   object (matches compile-array.go:712-717).
 * snapshot key existence pre-arrayGet and re-check the slot post-op.
   If the slot was replaced by a scalar (handler trashed it) or the
   key now exists when it didn't before (handler created it), the
   write is skipped (compile-array.go:826-862, bug70662 semantics).

Verified bit-identical to AST on assign_dim_op_undef, bug53432,
bug70662, plus the existing compound/incdec smoke tests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

38 of 119 new or added lines in 2 files covered. (31.93%)

15002 of 119547 relevant lines covered (12.55%)

2557.39 hits per line

Uncovered Changes

Lines Coverage ∆ File
74
51.06
-1.13% core/vm/vm.go
7
56.34
-0.18% core/vm/vmcompiler/emit_expr.go
Jobs
ID Job ID Ran Files Coverage
1 26434971110.1 26 May 2026 05:54AM UTC 398
12.55
GitHub Action Run
Source Files on build 26434971110
  • Tree
  • List 398
  • Changed 4
  • Source Changed 3
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26434971110
  • 6291adc7 on github
  • Prev Build on master (#26434484640)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc