This is an archive of the discontinued LLVM Phabricator instance.

[LibCalls] Mark puts/printf/perror as inaccessible_mem_or_argmem.
Needs RevisionPublic

Authored by fhahn on Aug 22 2022, 12:09 PM.

Details

Summary

Unless I am missing something, those functions should only access
either memory accessible through their arguments or inaccessible memory.

If I am not missing anything, it would probably be worth to add that
attribute to most libcalls.

Diff Detail

Event Timeline

fhahn created this revision.Aug 22 2022, 12:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 12:09 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
fhahn requested review of this revision.Aug 22 2022, 12:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 12:09 PM
efriedma requested changes to this revision.Aug 22 2022, 12:21 PM

They can also write to errno.

This revision now requires changes to proceed.Aug 22 2022, 12:21 PM

They can also write to errno.

Argh, right, that's a shame. I think the most interesting property would be that they don't access local objects that have been captured. But I think we don't have a way to model that at the moment?