
Change memCache so that the preloaded memory is not read immediately but only after the actual read to the preloaded range. This allows us to request caching the entire stack frame every time we create an eval scope and no unnecessary reads will be made even if the user is just trying to evaluate a global variable.
15 lines
333 B
Go
15 lines
333 B
Go
package proc
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestIssue554(t *testing.T) {
|
|
// unsigned integer overflow in proc.(*memCache).contains was
|
|
// causing it to always return true for address 0xffffffffffffffff
|
|
mem := memCache{true, 0x20, make([]byte, 100), nil}
|
|
if mem.contains(0xffffffffffffffff, 40) {
|
|
t.Fatalf("should be false")
|
|
}
|
|
}
|