aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/decode_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-04-14 18:28:19 +0800
committerFelix Lange <fjl@twurst.com>2015-04-17 20:45:09 +0800
commit6788f955c2414b025a4ea44efaf51caf50aa97f0 (patch)
tree8f72f8a9d9da95e3874cec926c693b6a1b9d87a7 /rlp/decode_test.go
parent509d0a8d78236562d9444a6fe851aec3cee5bb5e (diff)
downloaddexon-6788f955c2414b025a4ea44efaf51caf50aa97f0.tar.gz
dexon-6788f955c2414b025a4ea44efaf51caf50aa97f0.tar.zst
dexon-6788f955c2414b025a4ea44efaf51caf50aa97f0.zip
rlp: fix handling of single byte zero when decoding into a pointer
A single zero byte carries information and should not set the pointer to nil. This is arguably a corner case. While here, fix the comment to explain pointer reuse.
Diffstat (limited to 'rlp/decode_test.go')
-rw-r--r--rlp/decode_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/rlp/decode_test.go b/rlp/decode_test.go
index a64bfe3fd..e5c7f3761 100644
--- a/rlp/decode_test.go
+++ b/rlp/decode_test.go
@@ -378,7 +378,7 @@ var decodeTests = []decodeTest{
},
// pointers
- {input: "00", ptr: new(*uint), value: (*uint)(nil)},
+ {input: "00", ptr: new(*uint), value: uintp(0)},
{input: "80", ptr: new(*uint), value: (*uint)(nil)},
{input: "C0", ptr: new(*uint), value: (*uint)(nil)},
{input: "07", ptr: new(*uint), value: uintp(7)},