X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=src%2Fexec.c;h=3fb2771099964802f38745a35381f47b458f8329;hp=61faee3d1c21c2a00bfb238b15741b3b3b689384;hb=00272c954ced5a20c2ea9452ac3d9b4a67dc01c1;hpb=f9ad3a081e1777bb6d892af65d0e4090cb31bbfa diff --git a/src/exec.c b/src/exec.c index 61faee3..3fb2771 100644 --- a/src/exec.c +++ b/src/exec.c @@ -99,7 +99,7 @@ void svcin() --i; break; } - if(sys->cpu->gr[1] + i >= sys->memsize - 1) { + if(sys->cpu->gr[1] + i > execptr->end) { setcerr(208, NULL); /* SVC input - memory overflow */ break; } @@ -118,7 +118,7 @@ void svcout() WORD w; for(i = 0; i < sys->memory[sys->cpu->gr[2]]; i++) { - if(sys->cpu->gr[1] + i >= sys->memsize - 1) { + if(sys->cpu->gr[1] + i > execptr->end) { setcerr(209, NULL); /* SVC output - memory overflow */ return; }