MMIX LOGO

MMIX Bug Report Umlaut

Table of Content

Content

MMIXware Version

mmix-20110831

Bug Reported

Initial: 30/1/2013

Author

Martin Ruckert

Description

mmixal considers symbols containing character codes greater than 127 as undefined.

Details

The following MMIX program
pâté 	IS 	$0
Main	SET	pâté,0
produces the following error messages:
umlaut.mms", line 2: X field is undefined!
(One error was found.)
The bug is hidden in the function trie_search, where tt->ch, an unsigned short, is compared to *p, a char, like this
      while (*p!=tt->ch) {
and set like this
 tt->ch=*p++;
A char might be (depending on the compiler) a signed or an unsigned quantity. In the first case 'â' < 0 in the later 'â' > 0x7F. In the first case *p will not compare correctly to tt->ch.

Proposed Patch

In mmixal.w in the function trie_search replace
    register Char *p=s;
by
    register unsigned char *p=(unsigned char *)s;
and
       terminator=p;@+return tt;
by
       terminator=(Char*)p;@+return tt;

Discussion

The patch as given above is now part of the sources.

Please help to keep this site up to date! If you want to point out important material or projects that are not listed here, if you find errors or want to suggest improvements, please send email to email