Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334312

Summary: Bad code generated for SysMin_putch() on ARM M3 target
Product: [Technology] RTSC Reporter: Dave Russo <d-russo>
Component: RuntimeAssignee: Dave Russo <d-russo>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: ademars, d-russo, dfriedland
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Windows XP   
Whiteboard:

Description Dave Russo CLA 2011-01-13 14:42:00 EST
+++ This bug was initially created as a clone of Bug #333928 +++

Build Identifier: 3.20.06.81 and 3.21.00.30

The code generated for the C code below:
 
        if (module->outidx == SysMin_bufSize) {
            module->outidx = 0;
            module->wrapped = TRUE;
        }
        module->outbuf[module->outidx++] = ch;

actually executes like this:

        old_outindex = module->outidx;

        if (old_outidx == SysMin_bufSize) {
            module->outidx = 0;
            module->wrapped = TRUE;
        }
        module->outidx++;
        module->outbuf[old_outidx] = ch;

This results in a scribbling of the memory address one beyond the end of the SysMin output buffer whenever the output buffer index wraps.

Reproducible: Always
Comment 1 Dave Russo CLA 2014-02-07 20:46:35 EST
bogus clone of a bug that has already been fixed and verified.