You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a method has a parameter of type []byte, the underlying NeoVM type could be a ByteString or a Buffer at runtime. With the type of a parameter declared as []byte, that parameter can be passed to methods that require a Buffer on the NeoVM. If the passed parameter is of type ByteString the execution will fail at runtime.
Suggestion:
Add a compiler configuration that would prepend a type check on the NeoVM and convert the argument to a buffer if necessary. E.g., prepending something like the following before any LDARG opcode with an index to a parameter of the Java type []byte:
DUP
ISTYPE 30 (type buffer)
JMPIF 3 (jump over the convert opcode)
CONVERT 30
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When a method has a parameter of type
[]byte, the underlying NeoVM type could be aByteStringor aBufferat runtime. With the type of a parameter declared as[]byte, that parameter can be passed to methods that require aBufferon the NeoVM. If the passed parameter is of typeByteStringthe execution will fail at runtime.Suggestion:
Add a compiler configuration that would prepend a type check on the NeoVM and convert the argument to a buffer if necessary. E.g., prepending something like the following before any
LDARGopcode with an index to a parameter of the Java type[]byte:Beta Was this translation helpful? Give feedback.
All reactions