aboutsummaryrefslogtreecommitdiff
path: root/internal/compile
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2019-01-15 06:21:17 -0800
committeralandonovan <adonovan@google.com>2019-01-15 09:21:17 -0500
commitd37220ea0f192e8167c26989f8ae23a66aba2d71 (patch)
treedf18812f36ff04fa82a9968d63eaa05354ce8561 /internal/compile
parentbf3b58730bb699ee6bf7e06583f25bf9b46c4249 (diff)
downloadstarlark-go-d37220ea0f192e8167c26989f8ae23a66aba2d71.tar.gz
starlark: reject double-signs and misplaced signs in int (#112)
The implementation of the int built-in explicitly handles signs and then strips them. It then passes the remaining string to math/big. However, math/big also accepts and handles signs. This led to int("--4") returning 4 (somewhat correctly), and to int("0x-4", 16) returning -4 (again, somewhat correctly). Since we are handling sign explicitly, check for and complain about signs in strings we are about to pass in to math/big. Follow-up to #108 and #109.
Diffstat (limited to 'internal/compile')
0 files changed, 0 insertions, 0 deletions