This Basic code succeeds in release version: Space(-1) In release version, this aborts because of failed assertion. 1. In VBA, this code gives Invalid Procedure Call run-time error (5). We need to do the same in VBASupport mode. 2. We can't do that in non-VBA mode, because there is existing code relying on current behavior. We need to sanitize the passed value instead, so that it reaches the internals, where the "non-negative" preconditions must be met, in a valid state. Code pointer: SbRtl_Space in basic/source/runtime/methods.cxx. The patch must contain unit tests both for non-VBA, and VBA support cases.
(In reply to Mike Kaganski from comment #0) > In release version, this aborts because of failed assertion. A thinko: it was intended to be "In *debug* version, this aborts because of failed assertion"
bl4ze4447 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c15d89a0a67122879d6597df590fbfbc130c0c4b tdf#166673 Fix Space(-1) behaviour It will be available in 26.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
bl4ze4447 committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/2bbd8be0d2792c9655868d8958cd73057c489cec tdf#166673 Fix Space(-1) behaviour It will be available in 26.2.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.