]> Devi Nivas Git - cs3210-lab0.git/commit
believe it or not, this was working
authorrsc <rsc>
Thu, 27 Sep 2007 05:13:10 +0000 (05:13 +0000)
committerrsc <rsc>
Thu, 27 Sep 2007 05:13:10 +0000 (05:13 +0000)
commit666f58c711eafbdccb8abfe530b935505ab6eaa6
tree07b6b693d5087b2237cceef262f0d934f2536cc3
parent90d975e9c8a540efb380435f0dfc1369bad684ae
believe it or not, this was working

the macro expansion of "char *cp;" turned into
char *(curproc[cpu()]);  which declares a dynamically
sized array of char* called curproc.

so then &cp == &(curproc[cpu()]) was actually a
stack variable as "expected".  it was one past the
end of the array, but the implicit alloca allocated
more than was necessary.

do not tell me that making cp a #define was a bad idea.
there are worse problems to fix.  more on that later.
dot-bochsrc
sysfile.c
usertests.c