Commit graph

29 commits

Author SHA1 Message Date
carl a6120c220e Fix buffer overflow issue. 2019-03-25 00:13:42 +08:00
George Koehler ac4cbd735e Use libc assert(); fix dependencies; unbreak isduo().
Switch from custom assert() to libc assert() in mach/proto/as.
Continue to disable asserts if DEBUG == 0.

This change found a problem in the build system; comm2.y was missing
depedencies on comm0.h and comm1.h.  Add the missing dependencies to
the cppfile rule.  Allow the dependencies by modifying cppfile in
first/build.lua to act like cfile if t.dir is false.

Now that comm2.y gets rebuilt, I must fix the wrong prototype of
yyparse() in comm1.h.

I got unlucky as induo() in comm5.c was reading beyond the end of the
array.  It found an operator "= " ('=' then space) in the garbage, so
it returned a garbage token number, and "VAR = 123" became a syntax
error.  Unbreak induo() by terminating the array.
2017-11-11 16:09:05 -05:00
George Koehler d347207e60 Add more prototypes in mach/proto/as
Change "register i;" to "int i;" to so clang stops warning about
implicit int.  Use function prototypes so clang stops warning about
implicitly declared functions.
2017-11-10 23:30:46 -05:00
George Koehler e97116c037 Remove some obsolete code that causes a gcc warning.
In my OpenBSD/amd64 system, the code becomes

    if (0)
        outname.on_valu &= ~(((0xFFFFFFFF)<<32)<<32);

The 0xFFFFFFFF is a 32-bit int, so the left shift by 32 is out of
range and causes the gcc warning.

The intent might be to clear any sign-extended bits, if the assignment
outname.on_valu = valu did sign extension.  Old C had no unsigned
long, so .on_valu would have been long.  The code is obsolete because
h/out.h now declares .on_valu as uint32_t.
2017-01-16 18:09:55 -05:00
David Given fd91851005 Add enough return types to the K&R C that the ACK builds (on Linux) using clang
now.
2016-11-10 22:04:18 +01:00
David Given ef8e6e25e0 Fix a whole pile of issues related to the failed attempt to increase
the number of types of relocation possible in the object file. (Now,
hopefully, working.)

Also change the object serialiser/deserialiser to never try to read or
write raw structures; it's way safer this way and we don't need the
performance boost any more.

--HG--
branch : default-branch
2016-03-18 21:46:55 +01:00
ceriel 1db6a3029b Header --> Id 1994-06-24 14:02:31 +00:00
ceriel e30d27c418 Fixed bug in newlabel: assertion was wrong 1993-11-24 12:07:26 +00:00
ceriel 468d98750c Fixed problem with relocation,
added curr_token, so that parser can access token
1993-02-08 13:01:30 +00:00
ceriel 53c4951b29 Do not use '#endif/#else xxx'; it is not allowed for ANSI C 1991-12-17 15:05:43 +00:00
ceriel 0c59e2e12d Prevent name clashes with sys/types.h on system V 1991-12-16 15:24:24 +00:00
ceriel 0b26bdf5fb Some changes in search for more efficiency 1991-01-11 14:20:59 +00:00
ceriel 99bfba6a45 Added Johan's changes 1990-11-16 15:58:36 +00:00
ceriel 5c0938d05b Added some more support for debugger 1990-07-30 09:43:45 +00:00
ceriel 0c5cce9a96 max filename length too short in error messages 1990-01-31 16:27:05 +00:00
ceriel a46596cbba new object module makes buffering superfluous 1989-11-17 16:50:59 +00:00
ceriel 9953b58092 don't remove compiler generated labels when they are external 1989-06-19 11:19:22 +00:00
ceriel 4c76583aba simplified assertion 1989-01-19 13:48:09 +00:00
ceriel bd975e3041 removed some lint complaints 1988-06-28 13:43:54 +00:00
ceriel 0aa6d4ed5d corrected: a shift of 32 is not portable! 1988-04-21 18:40:42 +00:00
ceriel 16c73e6654 use malloc instead of sbrk 1987-08-06 13:04:20 +00:00
ceriel dd2cf6bbaa Fix in wrong assertion 1987-05-21 09:28:33 +00:00
ceriel 6eaf182cee Added Rcs Id 1987-03-10 11:49:39 +00:00
ceriel 815166e421 Added copyright notice 1987-03-09 19:15:41 +00:00
ceriel 04d031d33d Added some buffering for writes 1987-02-13 12:44:33 +00:00
ceriel aab8668d4b Bug fix 1987-01-28 15:15:28 +00:00
ceriel e188fe0956 Version that uses libobject.a 1986-12-01 15:41:29 +00:00
keie 5472fafa56 Add hoc solution of .align problem. 1985-04-23 12:55:01 +00:00
keie 772b64fabd *** empty log message *** 1985-04-12 16:56:43 +00:00