diff options
| author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-06-01 06:54:55 +0200 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-06-01 06:54:55 +0200 |
| commit | 1427ba31264b4f06ec7971612e5b406c5b57efd6 (patch) | |
| tree | 52374e4aa81491d482d0304382f2799693a4b35b | |
| parent | fb97665a14c347657e03f07d72098d2c9f76a65d (diff) | |
| download | plan9front-1427ba31264b4f06ec7971612e5b406c5b57efd6.tar.xz | |
pc64: fix for unsigned comparsion of (top - base) >= size
the rounding of base can make it above top, so have to
use signed comparsion.
| -rw-r--r-- | sys/src/9/pc64/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/9/pc64/main.c b/sys/src/9/pc64/main.c index 47b5e1c85..f0ef162bc 100644 --- a/sys/src/9/pc64/main.c +++ b/sys/src/9/pc64/main.c @@ -278,7 +278,7 @@ preallocpages(void) pm = &palloc.mem[i]; base = ROUND(pm->base, PGLSZ(1)); top = pm->base + (uvlong)pm->npage * BY2PG; - if((base + size) <= VMAPSIZE && (top - base) >= size){ + if((base + size) <= VMAPSIZE && (vlong)(top - base) >= size){ va = base + VMAP; pmap(m->pml4, base | PTEGLOBAL|PTEWRITE|PTEVALID, va, size); palloc.pages = (Page*)va; |
