From df84b151d54ec9b85fdd10fef65baefecef01848 Mon Sep 17 00:00:00 2001 From: David Jones Date: Thu, 11 Jul 1996 14:46:08 +0100 Subject: [PATCH] Fatal bug as vmstruct is not allocated Copied from Perforce Change: 15957 ServerID: perforce.ravenbrook.com --- mps/src/vman.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mps/src/vman.c b/mps/src/vman.c index ccfbf22ee37..f571eb40527 100644 --- a/mps/src/vman.c +++ b/mps/src/vman.c @@ -1,6 +1,6 @@ /* impl.c.vman: ANSI VM: MALLOC-BASED PSUEDO MEMORY MAPPING * - * $HopeName: MMsrc!vman.c(trunk.9) $ + * $HopeName: MMsrc!vman.c(trunk.10) $ * Copyright (C) 1996 Harlequin Group, all rights reserved. */ @@ -8,7 +8,7 @@ #include /* for malloc and free */ #include /* for memset */ -SRCID(vman, "$HopeName: MMsrc!vman.c(trunk.9) $"); +SRCID(vman, "$HopeName: MMsrc!vman.c(trunk.10) $"); #define SpaceVM(_space) (&(_space)->arenaStruct.vmStruct) @@ -41,6 +41,11 @@ Res VMCreate(Space *spaceReturn, Size size, Addr base) AVER(size != 0); AVER(base == NULL); + space = (Space)malloc(sizeof(SpaceStruct)); + if(space == NULL) + return ResMEMORY; + vm = SpaceVM(space); + /* Note that because we add VMAN_ALIGN rather than */ /* VMAN_ALIGN-1 we are not in danger of overflowing */ /* vm->limit even if malloc were peverse enough to give us */