You are not logged in.
After pulling the latest version of mormot2, when the program is running, accessing the properties or methods of the variable variant(TdocVariantData) will result in an error.
In the `mormot.core.variants.InitializeUnit` method, an exception is thrown when the final `test.add` is executed:
In file ‘mormot.core.base.asmx86.inc' at line 1066: movaps xmm1,[eax]
win10,win32 lazarus(trunk)+fpc(trunk)
Last edited by lfyey121 (2026-07-10 12:02:39)
Offline
Perhaps they changed something in the fpc trunk, which broke the code.
Please try with supported fpc version, i.e. 3.2 fixes (not 3.2.2).
Edit:
I just tried with latest trunk, no problem in DispInvoke here.
But, on Linux x64, there seem to be an issue with some code generation in Utf8ToWideChar(): the extra := UTF8_TABLE.Lookup[c]; instruction is clearly not well compiled.
I also tried on Win32 and Win64 and the tests do not pass, due to wrong code generation too.
The trunk codegen seems clearly broken: I looked at the generated asm, and the register allocator is clearly wrong (it uses a register for UTF8_TABLE but then it overwrite it before assuming it is still equal to UTF8_TABLE - clearly a compiler bug).
Perhaps in -O2 or -O1 it could be better. ![]()
Offline
After using FPC 3.2.3 and Lazarus 4.9, the same error still occurred. However, this error will not occur when mormot2 is reverted to version 2.4 stable.
Offline
I tested from O1 to O4, and all of them had the same error.
Offline
I previously set the compilation parameters for my program. After I changed the compiler options of the mormot2.lpk to -O2, the program ran without any errors.
Offline