Issue Details (XML | Word | Printable)

Key: CORE-1501
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Alexander Peshkov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Wrong access to SLONG data in dsql_nod.

Created: 05/Oct/07 09:06 AM   Updated: 26/Dec/07 12:47 PM
Component/s: Engine
Affects Version/s: 2.0.0, 2.0.1, 2.1 Alpha 1, 2.1 Beta 1, 2.0.2, 2.0.3
Fix Version/s: 2.1 RC1, 2.0.4

Time Tracking:
Not Specified

Environment: hpux 64-bit (probably any 64-bit big-endian CPU)


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 17/Oct/07 10:46 AM - edited
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.