Past: Start new job as software engineer out of college. Assigned an uncommented, undocumented, mess of a project with no training or mentors. I am the only person working on this project, nobody else knows or has ever seen the code at all.
I tell my manager that the code is very messed up and has bugs, but he tells me to work on features instead of fixing the code. Now months have passed and it is soon time to show program to client, and I am worried that I will be chastised for giving a partially "broken" program.
Since refactoring is not and never was an option due to time constraints and manager's wishes, what can I do to avoid my impending doom? I feel like I was unintentionally set up for failure from the very beginning. I even think that I made matters worse by adding features on top of the buggy code, since I had to do some weird things to bypass the bugs.
How can I avoid being chastised for a project I inherited which was already buggy, while I was told to work on more features instead of bug fixing?
EDIT: I feel like this is different than the question marked duplicate, as I am a brand new developer with 0 years experience. I feel like this is an important aspect of my situation.