Skip to content
Snippets Groups Projects
  • Lewis Hyatt's avatar
    6f46d14d
    libcpp: Fix paste error with unknown pragma after macro expansion · 6f46d14d
    Lewis Hyatt authored
    In directives.cc, do_pragma() contains logic to handle a case such as the new
    testcase pragma-omp-unknown.c, where an unknown pragma was the result of macro
    expansion (for pragma namespaces that permit expansion). This no longer works
    correctly as shown by the testcase, fixed by adding PREV_WHITE to the flags on
    the second token to prevent an unwanted paste.  Also fixed the memory leak,
    since the temporary tokens are pushed on their own context, nothing prevents
    freeing of the buffer that holds them when the context is eventually popped.
    
    libcpp/ChangeLog:
    
    	* directives.cc (do_pragma): Fix memory leak in token buffer.  Fix
    	unwanted paste between two tokens.
    
    gcc/testsuite/ChangeLog:
    
    	* c-c++-common/gomp/pragma-omp-unknown.c: New test.
    6f46d14d
    History
    libcpp: Fix paste error with unknown pragma after macro expansion
    Lewis Hyatt authored
    In directives.cc, do_pragma() contains logic to handle a case such as the new
    testcase pragma-omp-unknown.c, where an unknown pragma was the result of macro
    expansion (for pragma namespaces that permit expansion). This no longer works
    correctly as shown by the testcase, fixed by adding PREV_WHITE to the flags on
    the second token to prevent an unwanted paste.  Also fixed the memory leak,
    since the temporary tokens are pushed on their own context, nothing prevents
    freeing of the buffer that holds them when the context is eventually popped.
    
    libcpp/ChangeLog:
    
    	* directives.cc (do_pragma): Fix memory leak in token buffer.  Fix
    	unwanted paste between two tokens.
    
    gcc/testsuite/ChangeLog:
    
    	* c-c++-common/gomp/pragma-omp-unknown.c: New test.