[2871] in Athena Bugs
X11R4alpha mfbline.c causes bad code to be generated by hc compilers
daemon@ATHENA.MIT.EDU (epeisach@ATHENA.MIT.EDU)
Tue Aug 15 08:46:10 1989
From: <epeisach@ATHENA.MIT.EDU>
Date: Tue, 15 Aug 89 08:45:50 -0400
To: xbugs@expo.lcs.mit.edu
Cc: bugs@ATHENA.MIT.EDU
X Window System Bug Report
xbugs@expo.lcs.mit.edu
VERSION:
R4alpha
CLIENT MACHINE and OPERATING SYSTEM:
[e.g. Sun 3/280 running SunOS 4.0.1, Microvax II running Ultrix 3.1, ...]
IBM RT/pc running Bsd 4.3
DISPLAY:
[e.g. Digital QVSS, Sun CG4, HP Topcat, IBM APA16, Apollo 4 plane, ...]
IBM all displays
WINDOW MANAGER:
[e.g. uwm, twm, awm, wm, rtl, ...]
----
AREA:
[e.g. Xlib, xterm, uwm, server, doc, config, ...]
Server
SYNOPSIS:
[brief description of the problem and where it is located]
All versions of hc compiler from IBM (versions 1.4 -> 2.1r) have
a problem in handling double assignment to structures to a pointer
referenced structure. In mfbline.c this causes improper clipping of
dashed lines which causes the server to crash.
DESCRIPTION:
[detailed description]
The following code causes pt1 to be assigned but pt1Orig to not
be. This problem has been reported to IBM in the past. The problem also
existed in X11R3 server/ddx/ibm/apa16/apa16Line.c.
pt1Orig = pt1 = *pptInit++;
REPEAT BY:
[what you did to get the error; include test program if appropriate]
On an IBM system, running bitmap with a 200x200 bitmap caused
the server to crash.
SAMPLE FIX:
[preferred, but not necessary. Please send context diffs (diff -c -b)]
Any optimizing compiler that handles this correctly would
probably optimize it anyways.
retrieving revision 1.1
diff -b -c -r1.1 mfbline.c
*** /tmp/,RCSt1003688 Tue Aug 15 08:43:57 1989
--- mfbline.c Tue Aug 15 08:35:42 1989
***************
*** 696,702 ****
{
if (pdash->newLine)
{
! pt1Orig = pt1 = *pptInit++;
pt2 = *pptInit;
adx = pt2.x - pt1.x;
ady = pt2.y - pt1.y;
--- 696,703 ----
{
if (pdash->newLine)
{
! pt1Orig = *pptInit;
! pt1 = *pptInit++;
pt2 = *pptInit;
adx = pt2.x - pt1.x;
ady = pt2.y - pt1.y;