You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit fixes several critical issues in the magic variables test suite:
1. Fix RuntimeGlob cannot be cast to RuntimeCode crash (line 745)
- Separated CODE and GLOB cases in RuntimeScalar.toStringRef()
- Previously both cases were handled together causing incorrect type casting
- Fixes fatal crash when converting glob to string reference
2. Initialize $^T magic variable with epoch time (test 98)
- Added initialization of $^T to current Unix timestamp in GlobalContext
- $^T represents script start time in seconds since epoch
3. Make ${^TAINT} read-only (test 127)
- Use existing RuntimeScalarCache.scalarZero for ${^TAINT}
- Leverages existing RuntimeScalarReadOnly infrastructure for immutability
- Properly throws 'Modification of a read-only value' exception on write
4. Prevent auto-vivification of glob slots (test 85)
- Modified RuntimeGlob.hashDerefGet() to check slot existence
- *glob{HASH} and *glob{ARRAY} now return undef if slots don't exist
- Prevents unwanted creation of hash/array slots on access
Test Results:
- Before: Multiple failures including fatal crash
- After: 158/208 tests passing (76% pass rate)
- Eliminated fatal crash, improved stability
Files Modified:
- RuntimeScalar.java: Fixed glob/code toStringRef() handling
- GlobalContext.java: Initialize $^T, use scalarZero for ${^TAINT}
- RuntimeGlob.java: Check existence before auto-vivifying slots
0 commit comments