tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Bounds checking


From: Nigel Horne
Subject: [Tinycc-devel] Bounds checking
Date: Sat, 30 Nov 2002 14:10:48 +0000
User-agent: KMail/1.4.1

O've just downloaded the latest RPM of tcc (took ages because the
server was always "too busy"): tcc-0.9.13-1. Before anyone says: I know that 
it isn't 0.9.14, but 0.9.13 is the latest RPM.

I compiled both these programs with tcc -gb, but neither gave me a bounds 
error, why?

-Nigel

---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2002-11-30 14:09 GMT by <address@hidden>.
# Source directory was `/tmp'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#     74 -rw-rw-r-- a.c
#    110 -rw-rw-r-- b.c
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 
2001123123
59.59 -a -f $$.touch; then
  shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 
12312359200
1.59 -a ! -f 123123592001.5 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a 
-f
 $$.touch; then
  shar_touch='touch -am $3$4$5$6$2 "$8"'
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh22852; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= a.c ==============
if test -f 'a.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'a.c' '(file already exists)'
else
  $echo 'x -' extracting 'a.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'a.c' &&
main()
{
X       char *hello = "hello";
X       char *ptr = &hello[10];
X
X       puts(ptr);
}
X
SHAR_EOF
  (set 20 02 11 30 13 59 12 'a.c'; eval "$shar_touch") &&
  chmod 0664 'a.c' ||
  $echo 'restore of' 'a.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'a.c:' 'MD5 check failed'
7080005663d2694bc5ccf6889021b160  a.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'a.c'`"
    test 74 -eq "$shar_count" ||
    $echo 'a.c:' 'original size' '74,' 'current size' "$shar_count!"
  fi
fi
# ============= b.c ==============
if test -f 'b.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'b.c' '(file already exists)'
else
  $echo 'x -' extracting 'b.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'b.c' &&
main()
{
X       char *hello = (char *)malloc(6);
X       char *ptr = &hello[10];
X
X       strcpy(hello, "hello");
X
X       puts(ptr);
}
X
SHAR_EOF
  (set 20 02 11 30 14 01 10 'b.c'; eval "$shar_touch") &&
  chmod 0664 'b.c' ||
  $echo 'restore of' 'b.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'b.c:' 'MD5 check failed'
e3d151a9c54cbd5f2b31c8b3cfdb600f  b.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'b.c'`"
    test 110 -eq "$shar_count" ||
    $echo 'b.c:' 'original size' '110,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh22852
exit 0

-- 
Nigel Horne. Arranger, Composer, Conductor, Typesetter.
Owner of the brass band group of the Internet. ICQ#20252325
address@hidden http://bandsman.co.uk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]