X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fexec.c;h=3fb2771099964802f38745a35381f47b458f8329;hb=3a3755494c8fe62e90040532927860055ba74b2e;hp=61faee3d1c21c2a00bfb238b15741b3b3b689384;hpb=93f3bbbc043d2883610bd979556e0bae42e5c8b2;p=YACASL2.git 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; }