timer: fix two corruption bugs.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 19 May 2015 06:59:54 +0000 (16:29 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 19 May 2015 07:07:26 +0000 (16:37 +0930)
commit08dac1288246b1fc9efe1695fe4c7575103e4a2b
treec5dee07d46b48496711e37c3af96db1762b01787
parentbd9a48e7ffca063e21d580e9e0d94b1691c03687
timer: fix two corruption bugs.

We fill the upper buckets after we've moved on from the first bucket
in this layer.  This means two things:
1) If we have to look at an upper layer, we need to look at the next bucket,
   unless offset is 0.
2) We need to keep looking up layers in the corner case, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/timer/test/run-corrupt.c [new file with mode: 0644]
ccan/timer/test/run-original-corrupt.c [new file with mode: 0644]
ccan/timer/timer.c