External Libary Native Functions input different values from the actual parsed argument values #16

Open
opened 2026-01-22 08:13:13 +11:00 by DiamondNether90 · 1 comment

Edit: This has been temporarily fixed, at the cost of ground variables taking up 3x the size.

The Bug

When using external libraries, the args.values[0].data.___Val returns an incorrect value. This makes external libraries completely unusable.

Evidence: Create a custom function, and include printf("%lo\n", args.values[0].data.intVal) at the beginning. This will print a different number to the integer argument that was parsed.

The Cause

This bug goes away when removing the struct GroundStruct* customType; line from within typedef struct GroundValue { ... } GroundValue; definition. I would assume this is due to the new field not being initialised properly in some important function.

Edit: This has been temporarily fixed, at the cost of ground variables taking up 3x the size. ## The Bug When using external libraries, the args.values[0].data.___Val returns an incorrect value. This makes external libraries completely unusable. Evidence: Create a custom function, and include `printf("%lo\n", args.values[0].data.intVal)` at the beginning. This will print a different number to the integer argument that was parsed. ## The Cause This bug goes away when removing the `struct GroundStruct* customType;` line from within `typedef struct GroundValue { ... } GroundValue;` definition. I would assume this is due to the new field not being initialised properly in some important function.
DiamondNether90 started working 2026-01-22 08:13:23 +11:00
DiamondNether90 worked for 3 seconds 2026-01-22 08:13:26 +11:00
DiamondNether90 deleted spent time 2026-01-22 08:13:30 +11:00
- 3 seconds
Author
Member

Note: This issue first occured in commit 925077d55e, PR #12: merge master into unstable.

Note: This issue first occured in commit `925077d55e`, PR #12: merge `master` into `unstable`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ground/cground#16