This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Adjust code path of ChooseExternalSymbolizer for Windows
ClosedPublic

Authored by yingcong-wu on Apr 21 2023, 2:07 AM.

Details

Summary

If path is null, user_path must also be null. With the current code path, the message of explicitly disabling symbolizer will never be reported. This patch adjusts the if-else structure to make that message can be reported.

Diff Detail

Event Timeline

yingcong-wu created this revision.Apr 21 2023, 2:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2023, 2:07 AM
Herald added a subscriber: Enna1. · View Herald Transcript
yingcong-wu requested review of this revision.Apr 21 2023, 2:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2023, 2:07 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
yingcong-wu edited the summary of this revision. (Show Details)Apr 21 2023, 2:08 AM
cchen15 accepted this revision.Apr 24 2023, 6:52 AM

LGTM.

This revision is now accepted and ready to land.Apr 24 2023, 6:52 AM

Ping @vitalybuka, could you please review this patch?

Hi @MaskRay , could you please take a look at this patch and help land it?

MaskRay accepted this revision.Jun 12 2023, 3:35 PM

[sanitizer] adjust if-else block structure to make code reachable

Thanks. I think [sanitizer] Adjust ChooseExternalSymbolizer for Windows may be more meaningful. The most significant code change is to provide a diagnostic when external_symbolizer_path= (empty). Removing an unreachable code path is a side effect.

Block2 is unreachable(user_path must not be null if want to go into block2, but that means path will never be null, which block1 will run, NOT going into block2). [...]

You can simplify this to: If path is null, user_path must also be null. ...

yingcong-wu retitled this revision from [sanitizer] adjust if-else block structure to make code reachable to [sanitizer] Adjust code path of ChooseExternalSymbolizer for Windows.Jun 12 2023, 6:57 PM
yingcong-wu edited the summary of this revision. (Show Details)

Thank @MaskRay for your comment, I have updated the description of the patch.

Hi @MaskRay, I don't have commit access, could you please help commit this patch?