Skip to content

Regression in rewriter #204

Closed
Closed
@Machiry

Description

@Machiry

Consider the following code:

#define	ulong	unsigned long

ulong *		TOP;
ulong			channelColumns;

void
DescribeChannel(void)
{
    ulong	col;
    TOP = (ulong *)malloc((channelColumns+1) * sizeof(ulong));
    TOP[col] = 0;
}

When you run with alltypes:
./cconv-standalone -alltypes <foo.c>, you get the following:

#define	ulong	unsigned long

_Array_ptr<unsigned long> TOP = ((void * TOP)0);
ulong			channelColumns;

void
DescribeChannel(void)
{
    ulong	col;
    TOP = (_Array_ptr<unsigned long> )malloc((channelColumns+1) * sizeof(ulong));
    TOP[col] = 0;
}

See the invalid cast:

_Array_ptr<unsigned long> TOP = ((void * TOP)0);

This has to be:

_Array_ptr<unsigned long> TOP = ((void *)0);

Some issue with the latest DeclRewriter refactoring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    regressionThe things which were working before are breaking now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions