Modify ↓
Opened 6 months ago
Last modified 6 months ago
#4007 new Bug
Inconsistent pointer arithmetic
Reported by: | Pickwy | Owned by: | |
---|---|---|---|
Milestone: | Component: | AutoIt | |
Version: | 3.3.16.1 | Severity: | None |
Keywords: | pointer math arithmetic | Cc: | admin@… |
Description
Pointers have several inconsistencies during mathematical operations, some of which should be considered bugs :
Local $Test1 = Ptr(1) + 1 ConsoleWrite(VarGetType($Test1) & @CRLF) ;Print "Ptr" (OK) Local $Test2 = 1 + Ptr(1) ConsoleWrite(VarGetType($Test2) & @CRLF) ;Print "Double" (Expected : "Ptr") Local $Test3 = Ptr(1) + Ptr(1) ConsoleWrite($Test3 & @CRLF) ;Print "0x0000000000000002" (OK) Local $Test4 = Ptr(2) - Ptr(1) ConsoleWrite($Test4 & @CRLF) ;Print "0x0000000000000001" (OK) Local $Test5 = Ptr(3) * Ptr(2) ConsoleWrite($Test5 & @CRLF) ;Print "0x0000000000000003" (Expected : "0x0000000000000006") Local $Test6 = Ptr(4) / Ptr(2) ConsoleWrite($Test6 & @CRLF) ;Print "0x0000000000000004" (Expected : "0x0000000000000002")
Attachments (0)
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Note: See
TracTickets for help on using
tickets.
Some other variant type have the same strange behavior like the Default keyword :
Default + (Int32)2 = (Double)1
Default - (Int32)2 = (Int32)-2
Default * (Int32)2 = Default
Default / (Int32)2 = Default