#47 Wrong CIL transformation

Bug
closed-fixed
nobody
5
2006-10-27
2006-10-19
eertbrud
No

I've run into a buggy CIL transformation for a global
var, which is not referenced in this file, but
referenced from other files in the project.
There are 2 problems:
- CIL does not keep the original var. name, so linking
will fail because there is no var with the original
name in the transformed source file
- the newly created vars can occur in different source
files with the same name, which again gives linker
problems because the same global var is defined in
several files.

Does anyone know a workaround or a fix?

Thanks,
Dany

The offending code:

logger_deprecated_event *event_list_CHASSIS_deprecated[]=
{

&(logger_deprecated_event){"redSecondaryCPMStatusChange",
2013},
&(logger_deprecated_event){"redRestoreSuccess", 2014},
&(logger_deprecated_event){"redRestoreFail", 2015},
NULL
};

which CIL transforms into:

struct logger_deprecated_event __constr_expr_0 =
{{(char const )'r', (char const )'e', (char const
)'d', (char const )'S',
(char const )'e', (char const )'c', (char
const )'o', (char const )'n',
(char const )'d', (char const )'a', (char
const )'r', (char const )'y',
(char const )'C', (char const )'P', (char
const )'M', (char const )'S',
(char const )'t', (char const )'a', (char
const )'t', (char const )'u',
(char const )'s', (char const )'C', (char
const )'h', (char const )'a',
(char const )'n', (char const )'g', (char
const )'e', (char const )'\000',
(char)0, (char)0, (char)0, (char)0, (char)0},
(tUint32 const )2013};
struct logger_deprecated_event __constr_expr_1 =
{{(char const )'r', (char const )'e', (char const
)'d', (char const )'R',
(char const )'e', (char const )'s', (char
const )'t', (char const )'o',
(char const )'r', (char const )'e', (char
const )'S', (char const )'u',
(char const )'c', (char const )'c', (char
const )'e', (char const )'s',
(char const )'s', (char const )'\000',
(char)0, (char)0, (char)0, (char)0,
(char)0, (char)0, (char)0, (char)0, (char)0,
(char)0, (char)0, (char)0, (char)0,
(char)0, (char)0}, (tUint32 const )2014};
struct logger_deprecated_event __constr_expr_2 =
{{(char const )'r', (char const )'e', (char const
)'d', (char const )'R',
(char const )'e', (char const )'s', (char
const )'t', (char const )'o',
(char const )'r', (char const )'e', (char
const )'F', (char const )'a',
(char const )'i', (char const )'l', (char
const )'\000'}, (tUint32 const )2015};

Discussion

  • Matt Harren

    Matt Harren - 2006-10-27

    Logged In: YES
    user_id=1278428

    Not sure what was wrong in the first point, but the second
    item is now fixed in revision 8585. Thanks!

     
  • Matt Harren

    Matt Harren - 2006-10-27
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks