fix: Hash::MultiValue + blib/arch — splice spill, deref slice, dclone hooks#478
Open
fix: Hash::MultiValue + blib/arch — splice spill, deref slice, dclone hooks#478
Conversation
…ne hooks Three bugs fixed: 1. JVM backend: splice with constant sub causes ASM frame crash handleSpliceBuiltin left the first arg on the JVM operand stack while evaluating remaining args. When those contained a function call (constant sub), the blockDispatcher's GOTOs created inconsistent stack depths at merge points. Fixed with register spilling, matching handlePushOperator's existing pattern. 2. Interpreter backend: @$ref[@idx] = ... unsupported The array slice assignment handler only supported @array[@idx] with plain IdentifierNode. Added a branch to handle dereferenced array refs using DEREF_ARRAY/DEREF_ARRAY_NONSTRICT opcodes. 3. Storable::dclone: shared refs from STORABLE_freeze hooks dclone passed extra refs from STORABLE_freeze directly to STORABLE_thaw without cloning them. Inside-out objects like Hash::MultiValue ended up sharing internal arrays between original and clone. Fixed by deep-cloning extra refs (indices 1+). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The generated Makefile pure_all target only created blib/lib/ but not blib/arch/. The blib.pm pragma requires both directories to exist (-d blib && -d blib/lib && -d blib/arch), so use blib and -Mblib would die with Cannot find blib even in ... This caused CPAN module test suites (e.g. HTTP::Thin) to fail when they use open3 with -Mblib to verify modules load cleanly. Add mkdir -p blib/arch to the pure_all target so the directory always exists alongside blib/lib. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all
./jcpan -t Hash::MultiValuetest failures (was 7/10 programs passing, now 10/10) and the./jcpan -t HTTP::Thinblib/arch issue.Bug 1: JVM backend — splice with constant sub causes ASM frame crash
handleSpliceBuiltinleft the first arg on the JVM operand stack while evaluating remaining argsCfromuse constant), the blockDispatcher GOTOs created inconsistent stack depths at merge points, crashing ASMFrame.mergeEmitOperator.java, matching the existinghandlePushOperatorpatternBug 2: Interpreter backend —
@$ref[@idx] = ...unsupportedCompileAssignment.javaonly supported@array[@idx]with plainIdentifierNodeDEREF_ARRAY/DEREF_ARRAY_NONSTRICTopcodesBug 3: Storable::dclone — shared refs from STORABLE_freeze hooks
dclonepassed extra refs fromSTORABLE_freezedirectly toSTORABLE_thawwithout cloning themHash::MultiValueended up sharing internal arrays between original and cloneSTORABLE_thawinStorable.javaBug 4: blib/arch missing in generated Makefile
ExtUtils::MakeMakergenerated a Makefile whosepure_alltarget never createdblib/arch/blib.pmrequires it and dies if missing@mkdir -p blib/archto thepure_alltarget inExtUtils/MakeMaker.pmTest plan
makepasses (all unit tests)./jcpan -t Hash::MultiValue— 10/10 test programs, 55/55 subtests PASS./jcpan -t HTTP::Thin— blib/arch created correctlyGenerated with Devin