office-gobmx/basic
Mike Kaganski ff3791f67a tdf#163219: only create local With variable for function results
The problem is, that having a local variable referring the same value
as the original expression 'foo' is not the same as referencing 'foo'
itself. After 'foo' is re-assigned, the local variable still refers
to the original value, not the new one.

It seems impossible to implement the reference using existing codegen
primitives, to imitate the true reference to 'foo', not to its value.
If we implement it by changing the runtime, the bytecode won't work
identically in older versions; if we introduce a new bytecode, that
would be an incompatible change.

As a workaround, only create the local With variable, when the block
variable is created using some function (as much as known by parser).
I think that there would be cases when this would still not work as
intended: an example is a property implemented using getter function;
the parser would likely treat the property as a variable, and avoid
creation of the local variable; and the getter would be called every
time a dot access will happen (which was the essence of tdf#132064).
However, this seems a better alternative to the bug fixed here.

Change-Id: I50bf679762fd2e73f215a000fa0ab60fd6ae7453
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174564
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-07 09:38:38 +02:00
..
inc Related: tdf#158092 add a comment to avoid symbols localization 2024-09-11 17:01:09 +02:00
qa tdf#163219: only create local With variable for function results 2024-10-07 09:38:38 +02:00
source tdf#163219: only create local With variable for function results 2024-10-07 09:38:38 +02:00
util
AllLangMoTarget_sb.mk
CppunitTest_basic_macros.mk tdf#149714 BitsPerPixel property of Graphic has Boolean UNO type 2024-02-28 05:00:46 +01:00
CppunitTest_basic_scanner.mk tdf#160478: fix Basic LIKE operator 2024-04-02 19:47:35 +02:00
IwyuFilter_basic.yaml Recheck modules [a-c]* with IWYU 2022-01-13 08:26:15 +01:00
Library_sb.mk Use Windows dllmgr-x64 also for aarch64 2024-04-26 12:43:59 +02:00
Makefile
Module_basic.mk
README.md Updated README.md files to represent current code / use Markdown format 2021-04-07 17:47:16 +02:00

StarBASIC Interpreter

Contains the StarBASIC Interpreter

This implements a macro language that, when in VBA compatibility mode, is intended to be interoperable with Visual Basic for Applications, allowing people to run macros embedded in their documents.

See also

http://wiki.openoffice.org/wiki/Basic