jnaerator-0.9.10-SNAPSHOT-shaded.jar unable to process malloc def #278

Closed
rit001 opened this Issue Mar 1, 2012 · 1 comment

Projects

None yet

2 participants

@rit001
rit001 commented Mar 1, 2012

If the following 2 lines are placed in a .h file and passed to jnaerator, an error occurs


free( void * _Memory);
malloc( int _Size);


The output placed in _jnaerator.rawParsed.cpp only contains the following as jnaerator stops all further processing at the malloc line


free(void* _Memory);


If the following .h file is used instead it works correctly


free( void * _Memory);
malloc1( int _Size);


The output placed in _jnaerator.rawParsed.cpp is correct (as shown below)


free(void* _Memory);
malloc1(int _Size);


Looking at the jnaerator source code it is clear that there are dedicated handlers for memory allocation functions, so I am guessing that the handler for malloc has a problem.

Roger

@ochafik ochafik added a commit that referenced this issue Mar 2, 2012
@ochafik ochafik JNAerator: fixed parsing of free / malloc identifiers and of other po…
…tential GCC attributes (issue #278)
00b374d
@ochafik
Member
ochafik commented Mar 2, 2012

Hi @rit001 ,

Thank you very much for this report.

This wide-ranging bug was caused by interference with the "malloc" and "free" GCC attributes, that shouldn't be parsed outside attribute (fortunately easy to fix !).

Fix was deployed as new 0.9.10-SNAPSHOT

Cheers

@ochafik ochafik closed this Mar 2, 2012
@ochafik ochafik added a commit that referenced this issue Mar 7, 2012
@ochafik ochafik JNAerator: skip parsing of even more attributes outside of their vali…
…d scope (issue #278 and issue #280)
aa92710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment