Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334312 - Bad code generated for SysMin_putch() on ARM M3 target
Summary: Bad code generated for SysMin_putch() on ARM M3 target
Status: CLOSED INVALID
Alias: None
Product: RTSC
Classification: Technology
Component: Runtime (show other bugs)
Version: unspecified   Edit
Hardware: All Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dave Russo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-13 14:42 EST by Dave Russo CLA
Modified: 2014-02-07 20:46 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.