Opened on Apr 7, 2022 at 2:33:30 PM
Closed on Jun 2, 2022 at 1:54:02 PM
Last modified on Jun 2, 2022 at 2:04:16 PM
#3876 closed Bug (Fixed)
Hex Number Arithmetic is incorrect
| Reported by: | Zvend | Owned by: | Jon |
|---|---|---|---|
| Milestone: | 3.3.16.1 | Component: | AutoIt |
| Version: | 3.3.16.0 | Severity: | None |
| Keywords: | Hex Number Arithmetic | Cc: | Melba23 |
Description
The hex arithmetic in the newest version broke compared to previous versions.
;~ AutoIt v3.3.14.5 Const $OFFSET = -0x46 Local $pSomePointer = Ptr(0x3100000 + $OFFSET) ConsoleWrite("Pointer is: " & $pSomePointer & @CRLF)
Output:
Pointer is: 0x030FFFBA (Correct hex arithmetic)
;~ AutoIt v3.3.16.0 Const $OFFSET = -0x46 Local $pSomePointer = Ptr(0x3100000 + $OFFSET) ConsoleWrite("Pointer is: " & $pSomePointer & @CRLF)
Output:
Pointer is: 0x03100046 (Incorrect hex arithmetic)
For more information see: https://www.autoitscript.com/forum/topic/207897-hex-number-arithmetic-is-incorrect-on-v33160/
Attachments (0)
Change History (7)
comment:1 by , on Apr 8, 2022 at 9:55:17 AM
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:2 by , on Apr 10, 2022 at 10:01:31 PM
Hey, just for my information: When will the fix be applied? so i can continue moving my project to the newest autoit version
comment:3 by , on Apr 16, 2022 at 10:07:47 AM
follow-up: 5 comment:4 by , on Apr 20, 2022 at 4:56:43 PM
Hello,
i found the same problem in all beta versions since 3.3.14.5, you can bypass them by wrote
Const $OFFSET = -(0x46)
Sascha
comment:5 by , on Apr 22, 2022 at 2:38:48 AM
Replying to anonymous:
Hello,
i found the same problem in all beta versions since 3.3.14.5, you can bypass them by wrote
Const $OFFSET = -(0x46)Sascha
thats only a bypass for hardcoded offsets. If you have functions where you dont know if the output value is supposed to be positive or negative this bypass wont work out. also that "solution" was mentioned in the link i provided
comment:6 by , on Jun 2, 2022 at 1:54:02 PM
| Milestone: | → 3.3.15.6 |
|---|---|
| Owner: | changed from to |
| Resolution: | → Fixed |
| Status: | assigned → closed |
Fixed by revision [12732] in version: 3.3.15.6
comment:7 by , on Jun 2, 2022 at 2:04:16 PM
| Milestone: | 3.3.15.6 → 3.3.16.1 |
|---|
Fixed by revision [12734] in version: 3.3.16.1

Thanks,
Fix sent to Jon