Skip to content

Generic types not properly handled #236

Open
@Machiry

Description

@Machiry

For the following code:

_Itype_for_any(T) void *malloc(unsigned long size) : itype(_Array_ptr<T>) byte_count(size);
_Itype_for_any(T) void *vsf_sysutil_malloc(unsigned int size) : itype(_Array_ptr<T>) byte_count(size);
void *vsf_sysutil_malloc(unsigned int size) 
{
  void *p_ret;
  p_ret = malloc(size);
  return p_ret;
}

We wrongly convert the above example to be the following:

_Itype_for_any(T) void *malloc(unsigned long size) : itype(_Array_ptr<T>) byte_count(size);
void *vsf_sysutil_malloc(unsigned int size) : itype(_Array_ptr<void>) : itype(_Array_ptr<T>) byte_count(size);
void *vsf_sysutil_malloc(unsigned int size) : itype(_Array_ptr<void>) 
{
  void *p_ret;
  p_ret = malloc(size);
  return p_ret;
}

Here, the problem is we treating the generic type as a regular itype which is wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions