plasma-disassembler / plasma

Plasma is an interactive disassembler for x86/ARM/MIPS. It can generates indented pseudo-code with colored syntax.
GNU General Public License v3.0
3.05k stars 277 forks source link

Bug with goto in a loop #9

Closed ghost closed 9 years ago

ghost commented 9 years ago
#include <stdio.h>
#include <stdlib.h>
int main() {
    int i, j;
    if (i == 1) {
        printf("1\n");
        goto next;
    } else {
        printf("2\n");
    }
    while (i < 1) {
        printf("loop\n");
        if (j == 6) {
            printf("3\n");
        } else {
            printf("4\n");
        }
next:
        if (j == 5) {
            printf("5\n");
        } else {
            printf("6\n");
        }
        i++;
    }
    return 0;
}

When there is a "C-goto" which jump inside a loop, the program generate a wrong code.

CoolOppo commented 9 years ago

In case you didn't know, you can actually close an issue by referencing the issue number in the commit name.

https://help.github.com/articles/closing-issues-via-commit-messages/

ghost commented 9 years ago

Thank you I didn't know that.