Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks in presence of nested conditions #7

Open
fbehrang opened this issue May 31, 2015 · 1 comment
Open

Breaks in presence of nested conditions #7

fbehrang opened this issue May 31, 2015 · 1 comment
Labels

Comments

@fbehrang
Copy link

Consider the following code, on LLVM 3.5, I use "clang -emit-llvm esc.c -c -o esc.bc" and then "llc -march=c esc.bc -o esc-out.c", after I compile esc-out.c, I get an error "else without a previous 'if' ". I also tried some other functions with nested if-else, the same thing happened.

int esc(char _s, int *i)
{
char result;
if (s[_i] != '@')
result = s[_i];
else
if (s[_i + 1] == '\0')
result = '@';
else
{
_i = *i + 1;
if (s[_i] == 'n')
result = 10;
else
if (s[_i] == 't')
result = 9;
else
result = s[_i];
}
return result;
}

@rtc-draper rtc-draper added the bug label Jun 1, 2015
@rtc-draper
Copy link
Collaborator

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants