Vegard Nossum 2dfd937d7f Prevent lexer from reading beyond the end of the buffer
On Linux, valgrind complains about the overflow like this:

  Pass 1...
  ==20054== Invalid read of size 1
  ==20054==    at 0x406CDA: yylex (lexer.c:396)
  ==20054==    by 0x40207C: yyparse (asmy.c:2921)
  ==20054==    by 0x4086AF: main (main.c:351)
  ==20054==  Address 0x503a102 is 0 bytes after a block of size 23,538 alloc'd
  ==20054==    at 0x402994D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==20054==    by 0x406411: yy_create_buffer (lexer.c:147)
  ==20054==    by 0x404FE3: fstk_RunInclude (fstack.c:243)
  ==20054==    by 0x4025F5: yyparse (asmy.y:744)
  ==20054==    by 0x4086AF: main (main.c:351)
  ==20054==

This is a bit of a crude fix which simply exits the hashing loop when
we reach the end of the string. We should probably do some kind of
length calculation on the buffer instead.

Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
2012-10-21 06:06:54 +02:00
2010-12-22 14:26:43 -07:00
2009-09-11 22:45:47 -06:00

----------------
  RGBDS README
----------------

RGBDS (Rednex Game Boy Development System) is a free assembler/linker package
for the Game Boy and Game Boy Color. It consists of:

  - rgbasm  (assembler)
  - rgblink (linker)
  - rgblib  (library manager)
  - rgbfix  (checksum/header fixer)

rgbds-linux is a fork of the original RGBDS which aims to make the programs
more like other UNIX tools.


  Installing RGBDS (UNIX)
=========================

To build the programs on a UNIX or UNIX-like system, just run in your terminal:

  make

Then to install the compiled programs and manual pages, run (with appropriate
privileges):

  make install

After installation, you can read the manuals with the man(1) command. E.g.,

  man 1 rgbasm


Note: the variables described below can affect installation behavior when given
on the make command line. For example, to install rgbds in your home directory
instead of systemwide, run the following:

  mkdir -p $HOME/{bin,man/man1,man/man7}
  make install PREFIX=$HOME


PREFIX: Location where RGBDS will be installed. Defaults to /usr/local.

BINPREFIX: Location where the RGBDS programs will be installed. Defaults
to ${PREFIX}/bin.

MANPREFIX: Location where the RGBDS man pages will be installed. Defaults
to ${PREFIX}/man.

Q: Whether to quiet the build or not. To make the build more verbose, clear
this variable. Defaults to @.


  Installing RGBDS (Windows)
============================

Windows builds are available here: http://anthony.bentley.name/rgbds/

Copy the .exe files to C:\Windows\ or similar.
Description
Rednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color
Readme MIT 18 MiB
Languages
C++ 68%
Assembly 18%
Shell 6.8%
Yacc 5%
CMake 1%
Other 1%