From: ceriel Date: Mon, 3 Aug 1987 14:04:44 +0000 (+0000) Subject: fix: may no address more memory than is present blocks.c X-Git-Tag: release-5-5~3959 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=1640b8cad8eb8733a29b0eaaf8031f9a016d685c;p=ack.git fix: may no address more memory than is present blocks.c --- diff --git a/lang/cem/cemcom/Makefile b/lang/cem/cemcom/Makefile index bc358ff46..10f5dffe9 100644 --- a/lang/cem/cemcom/Makefile +++ b/lang/cem/cemcom/Makefile @@ -13,12 +13,13 @@ EMKLIB = $(EMHOME)/modules/lib/libemk.a EMELIB = $(EMHOME)/modules/lib/libeme.a STRLIB = $(EMHOME)/modules/lib/libstring.a PRTLIB = $(EMHOME)/modules/lib/libprint.a -EMMESLIB = $(EMHOME)/modules/lib/libem_mes.a +EMMESLIB = $(EMHOME)/modules/lib/libem_mesO.a INPLIB = $(EMHOME)/modules/lib/libinput.a ALLOCLIB = $(EMHOME)/modules/lib/liballoc.a MALLOC = $(EMHOME)/modules/lib/malloc.o -LIBS = $(INPLIB) $(EMMESLIB) $(EMKLIB) $(PRTLIB) $(STRLIB) \ - $(ALLOCLIB) $(MALLOC) $(SYSLIB) +LIBS = $(EMMESLIB) $(EMHOME)/modules/lib/libemopt.a $(EMHOME)/modules/lib/libread_emk.a \ + $(INPLIB) $(EMKLIB) $(PRTLIB) $(STRLIB) \ + $(ALLOCLIB) $(MALLOC) $(SYSLIB) $(EMHOME)/lib/em_data.a ELIBS = $(INPLIB) $(EMMESLIB) $(EMELIB) $(PRTLIB) $(STRLIB) \ $(ALLOCLIB) $(MALLOC) $(SYSLIB) LIB_INCLUDES = -I$(EMHOME)/modules/h -I$(EMHOME)/modules/pkg @@ -35,7 +36,7 @@ ALLOCLLIB = $(EMHOME)/modules/lib/llib-lalloc.ln LINTLIBS = $(EMMESLLIB) $(EMKLLIB) $(PRTLLIB) $(STRLLIB) $(ALLOCLLIB) $(SYSLLIB) CURRDIR = . -COPTIONS = +COPTIONS = -DPEEPHOLE # What parser generator to use and how GEN = $(EMHOME)/bin/LLgen @@ -118,12 +119,12 @@ Emain: Cfiles @rm -f nmclash.o a.out install: Main - rm -f $(EMHOME)/lib/em_cemcom $(EMHOME)/man/em_cemcom.6 - cp $(CURRDIR)/main $(EMHOME)/lib/em_cemcom + rm -f $(EMHOME)/lib/em_cemcomO $(EMHOME)/man/em_cemcom.6 + cp $(CURRDIR)/main $(EMHOME)/lib/em_cemcomO cp $(CURRDIR)/cemcom.1 $(EMHOME)/man/em_cemcom.6 cmp: Main - -cmp $(CURRDIR)/main $(EMHOME)/lib/em_cemcom + -cmp $(CURRDIR)/main $(EMHOME)/lib/em_cemcomO -cmp $(CURRDIR)/cemcom.1 $(EMHOME)/man/em_cemcom.6 pr: @@ -443,6 +444,7 @@ error.o: nopp.h error.o: spec_arith.h error.o: tokenname.h field.o: Lpars.h +field.o: align.h field.o: arith.h field.o: assert.h field.o: code.h @@ -678,7 +680,6 @@ conversion.o: spec_arith.h conversion.o: target_sizes.h conversion.o: type.h util.o: align.h -util.o: atw.h util.o: nocross.h util.o: nofloat.h util.o: sizes.h diff --git a/lang/cem/cemcom/Makefile.erik b/lang/cem/cemcom/Makefile.erik index 4d31d2232..a4d8f5af8 100644 --- a/lang/cem/cemcom/Makefile.erik +++ b/lang/cem/cemcom/Makefile.erik @@ -72,7 +72,7 @@ COBJ = main.o idf.o declarator.o decspecs.o struct.o \ input.o domacro.o replace.o init.o options.o \ scan.o skip.o stack.o type.o ch7mon.o label.o eval.o \ switch.o conversion.o \ - blocks.o dataflow.o Version.o + blocks.o dataflow.o Version.o util.o # Objects of other generated C files GOBJ = char.o symbol2str.o next.o @@ -80,7 +80,7 @@ GOBJ = char.o symbol2str.o next.o # generated source files GSRC = char.c symbol2str.c next.c \ code.h declar.h decspecs.h def.h expr.h field.h estack.h \ - idf.h macro.h stack.h stmt.h struct.h switch.h type.h + idf.h macro.h stack.h stmt.h struct.h switch.h type.h util.h # .h files generated by `make hfiles'; PLEASE KEEP THIS UP-TO-DATE! GHSRC = botch_free.h dataflow.h debug.h density.h errout.h \ @@ -95,7 +95,7 @@ GENERATED = tab tokenfile.g Lpars.h LLfiles LL.output lint.out \ # include files containing ALLOCDEF specifications NEXTFILES = code.str declar.str decspecs.str def.str expr.str field.str \ - estack.str \ + estack.str util.str \ idf.str macro.str stack.str stmt.str struct.str switch.str type.str .SUFFIXES: .str .h @@ -149,6 +149,7 @@ stmt.h: make.allocd struct.h: make.allocd switch.h: make.allocd type.h: make.allocd +util.h: make.allocd # Objects needed for 'main' OBJ = $(COBJ) $(LOBJ) $(GOBJ) diff --git a/lang/cem/cemcom/blocks.c b/lang/cem/cemcom/blocks.c index d7fc24493..b60b67fa1 100644 --- a/lang/cem/cemcom/blocks.c +++ b/lang/cem/cemcom/blocks.c @@ -96,11 +96,8 @@ load_block(sz, al) { arith esz = ATW(sz); /* effective size == actual # pushed bytes */ - if ((sz == al) && (word_align % al == 0)) + if (((sz == al) && (word_align % al == 0)) || (al % word_align == 0)) C_loi(sz); - else - if (al % word_align == 0) - C_loi(esz); else { #ifndef STB arith src, dst;