UBT can parse content that exceeds the length of the file

Define a marco at the end of a header file:

213585-ue4bug2.png

Open UnrealHeaderTool project, In the function “FBaseParser::GetChar”, add a breakpoint with condition “InputPos>InputLen+1”.Then start debugging UnrealHeaderTool with arguments copyed from the game project.
Wait until the breadpoint is triggered:

213586-ue4bug.png

At this moment, UBT starts to parse the part of “FBaseParser::Input” which is not belonged to the header file.Then
any unexpected compilation error maybe happened in other header files!!!

This bug took me a whole day to find…

Please to fix it as soon as possible :slight_smile:

Hi superman_tb,

When I added a macro to the end of a header file as you showed, the last \ character seemed to consume the end of file character. However, that only happened if I did not add some extra blank lines between the macro and the end of the file. If you do not include the last \ character, do you still run into this issue?

I was not able to get the conditional breakpoint that you mentioned setting to get hit. Could you clarify what arguments you are using when you start debugging UHT?

Hi, .

214304-bug4.png

I deleted the last '' character, and this issue was solved.

The arguments of UHT were as below:

Thank you very much.