Skip to content

Invalid parameter access #142

@pattersonz

Description

@pattersonz

When parameter variables in functions have implicit configurations and accessed within a function, both values appear.

typedef
#ifdef A
unsigned
#else
signed
#endif
tydef;

void printDigest(tydef x) {
    x++;
}

Produces this output: (desugaring & zjp branches)

#include <stdbool.h>

extern void __static_type_error(char *msg);
extern void __static_renaming(char *renaming, char *original);
extern void __static_condition_renaming(char *expression, char *renaming);

void __static_initializer_default();

extern const bool __static_condition_default_6;
extern const bool __static_condition_default_7;
extern const bool __static_condition_default_8;
void __static_initializer_default() {
__static_renaming("__tydef_0", "tydef");
__static_renaming("__tydef_1", "tydef");
__static_renaming("__printDigest_4", "printDigest");
__static_renaming("__printDigest_5", "printDigest");

__static_condition_renaming("__static_condition_default_6", "(declare-fun |(defined A)| () Bool)(assert |(defined A)|)");
__static_condition_renaming("__static_condition_default_7", "(declare-fun |(defined A)| () Bool)(assert (not |(defined A)|))");
__static_condition_renaming("__static_condition_default_8", "(declare-fun |(defined A)| () Bool)(assert (not |(defined A)|))");

};
typedef unsigned  __tydef_0;
typedef signed  __tydef_1;

// typedef moved to top of scope
// typedef moved to top of scope
void  __printDigest_4 (__tydef_0  __x_2) {

if (__static_condition_default_6) {
{

{
if (__static_condition_default_6) {
 __x_2  ++ ;

}

if (__static_condition_default_7) {
 __x_3  ++ ;

}

}}

}

}
void  __printDigest_5 (__tydef_1  __x_3) {

if (__static_condition_default_8) {
{

{
if (__static_condition_default_6) {
 __x_2  ++ ;

}

if (__static_condition_default_7) {
 __x_3  ++ ;

}

}}

}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions