× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Bruce Vining wrote:
Agreed, but I didn't want to give the answer away by saying "in an error
situation".

This sample will actually corrupt storage in the "non-error" situation. If
an API "sees" a Bytes Provided value greater than 8 (which qualifies with
this example) then the storage address four bytes beyond the address of the
"blank" is going to be updated to x'00000000' (Bytes Available) when no
error in the API call is detected. So storage is corrupted simply by calling
the API as demonstrated in the example. Assuming the temporaries RPG sets
aside for consts are 16-byte aligned then this corruption would go
undetected (for now and assuming RPG isn't using the other 15 bytes for
"something", which I doubt).


An alpha temporary would be declared as 1-byte aligned by the RPG compiler. The RPG compiler doesn't have any control over the layout of storage, so I don't know if the 15 bytes following the temporary would be used or not.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.