Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#840] Fix SIG-11 from $ZATRANSFORM when first argument is an undefin…
…ed variable Background ---------- * The below test case fails with YottaDB r1.32 but does not with r1.30. **Release build** ```m YDB>write $zatransform(x,0) %YDB-E-ZATRANSERR, The input string is too long to convert YDB>write $zatransform(x,0,2) %YDB-F-KILLBYSIGSINFO1, YottaDB process 91088 has been killed by a signal 11 at address 0x00007F4598A9DB8A (vaddr 0x0000000000000000) %YDB-F-SIGMAPERR, Signal was caused by an address not mapped to an object ``` **Debug build** ```m YDB>write $zatransform(x,0) %YDB-F-ASSERT, Assert failed in sr_port/op_fnzatransform.c line 75 for expression (FALSE) YDB>write $zatransform(x,0,2) %YDB-F-KILLBYSIGSINFO1, YottaDB process 91223 has been killed by a signal 11 at address 0x00007F2FC1DD9FB3 (vaddr 0x0000000000000000) %YDB-F-SIGMAPERR, Signal was caused by an address not mapped to an object ``` * This is a regression in #724 (0b63ce1 as part of !959) that was noticed during fuzz testing (#828). Issue ----- * If the input argument is undefined, the code in `op_fnzatransformm.c` used to return right away because it had a check of `if (0 == msrc->str.len)` at function entry. This check was modified as part of 0b63ce1 to additionally check for `MV_IS_STRING(msrc)`. This meant that undefined mvals will no longer return right away like before and that means they would go further down in the code and result in assert failures and/or SIG-11s like shown above. Fix --- * A `MV_FORCE_DEFINED(msrc)` call is now added at function entry. And that will take care of issuing the appropriate `LVUNDEF` error before proceeding further down in the code.
- Loading branch information