microsoft / Static-Module-Verifier

Static Module Verifier technology enables full module analysis using Microsoft Azure.
MIT License
9 stars 11 forks source link

Fix support for source filenames with dashes and spaces. #43

Closed NateD-MSFT closed 2 years ago

NateD-MSFT commented 2 years ago

Filenames in VS2022 and other compilers are valid even if they contain dashes or spaces. However, the interceptor does not correctly account for when these filenames are passed on, as they are often wrapped in quotation marks, which breaks our regex for detecting file names.

This change splits our regex logic so that we first look for filenames surrounded by quotes (ex. "hello world.c", "hello-world.c") and then filenames without quotes (helloworld.c). Later, when passing these filenames into the link stages, we make sure to re-apply quotation marks to ensure the interception linker correctly handles them as well.

NateD-MSFT commented 2 years ago

Found a bug in testing, will push fix after a fresh test pass finishes up.