Skip to content

VLA may cause a crash compiler #33

@zu2

Description

@zu2

it crash compiler.

#include "common.h"

int sub(int x)
{
	unsigned char	i;
	unsigned char	sum = 0;
	unsigned char	p[x];

	for (i=0; i<10; i++){
		p[i] = i;
	}
	for (i=0; i<10; i++){
		sum += p[i];
	}
	return sum;
}

int main(int argc, char **argv)
{
	return sub(10)!=45;
}

When node is ND_VAR, node->ty can be NULL. A temporary fix prevents a crash, but a fundamental solution is needed.

74f996f

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions