fix prodded by cnuke@ for AIX with IBM xlC 7.0:

fool the compiler into not doing static bounds checking when we do
one-past-the-array-boundary pointer assignments for cases where the
only accesses are like (*--pointer); bump version
This commit is contained in:
tg 2008-10-10 21:30:43 +00:00
parent 94b7792718
commit 37934a07cf
5 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.228 2008/10/05 16:06:42 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.229 2008/10/10 21:30:41 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -7,7 +7,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
@(#)MIRBSD KSH R35 2008/10/05
@(#)MIRBSD KSH R35 2008/10/10
description:
Check version of shell.
stdin:

4
lex.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.72 2008/09/30 19:35:10 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.73 2008/10/10 21:30:42 tg Exp $");
/*
* states while lexing word
@ -151,7 +151,7 @@ yylex(int cf)
states[0].ls_info.base = NULL;
statep = &states[1];
state_info.base = states;
state_info.end = &states[STATE_BSIZE];
state_info.end = &state_info.base[STATE_BSIZE];
Xinit(ws, wp, 64, ATEMP);

4
sh.h
View File

@ -100,9 +100,9 @@
#define __SCCSID(x) __IDSTRING(sccsid,x)
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.238 2008/10/05 16:06:43 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.239 2008/10/10 21:30:42 tg Exp $");
#endif
#define MKSH_VERSION "R35 2008/10/05"
#define MKSH_VERSION "R35 2008/10/10"
#ifndef MKSH_INCLUDES_ONLY

6
shf.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.21 2008/05/17 18:47:02 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.22 2008/10/10 21:30:43 tg Exp $");
/* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */
@ -835,7 +835,7 @@ shf_vfprintf(struct shf *shf, const char *fmt, va_list args)
case 'u':
case 'x':
flags |= FL_NUMBER;
cp = &numbuf[sizeof (numbuf)];
cp = numbuf + sizeof (numbuf);
/*-
* XXX any better way to do this?
* XXX hopefully the compiler optimises this out
@ -903,7 +903,7 @@ shf_vfprintf(struct shf *shf, const char *fmt, va_list args)
}
}
}
len = &numbuf[sizeof (numbuf)] - (s = cp);
len = numbuf + sizeof (numbuf) - (s = cp);
if (flags & FL_DOT) {
if (precision > len) {
field = precision;

4
syn.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.26 2008/08/02 17:45:12 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.27 2008/10/10 21:30:43 tg Exp $");
struct nesting_state {
int start_token; /* token than began nesting (eg, FOR) */
@ -163,7 +163,7 @@ synio(int cf)
iop->delim = yylval.cp;
if (*ident != 0) /* unquoted */
iop->flag |= IOEVAL;
if (herep >= &heres[HERES])
if (herep > &heres[HERES - 1])
yyerror("too many <<s\n");
*herep++ = iop;
} else