Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong access to SLONG data in dsql_nod. [CORE1501] #783

Closed
firebird-automations opened this issue Oct 5, 2007 · 6 comments
Closed

Wrong access to SLONG data in dsql_nod. [CORE1501] #783

firebird-automations opened this issue Oct 5, 2007 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @AlexPeshkoff

SLONG is stored in dsql_nod* (nod_arg[0]).
To put data in it,
nod_arg[0] = (dsql_nod*) (IPTR) number;
is used. I will not talk here about all casts, pure SLONG passes through to reach it's permanent location, it's not important here. But extraction is done in desc style. ie:
SLONG value = * (SLONG*) nod_arg;

This seems to be OK, and it's really OK for any 32-bit machine and for any little endian machine. On 64-bit big endian CPU 32-bit data is placed in one half of a 64-bit pointer, but taken from another one.

This ticket is only about dsql_nod, but there are may be more such places in the engine.

Commits: 543f986 e4271ba

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Added new function
dsql_nod* MAKE_const_slong(SLONG)
and method
SLONG dsql_nod::getConstant()
to deal with stored in dsql_nod 32-bit constants in the same way everywhere.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.1 RC1 [ 10201 ]

Fix Version: 2.0.4 [ 10211 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 13252 ] => Firebird [ 13989 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Cannot be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment