Stream: t-compiler/const-eval

Topic: #56985 in-bounds checks for live pointers


oli (Dec 21 2018 at 12:59, on Zulip):

I'm not quite sure how to proceed for #56985. On the one hand, we want function pointers (which have no backing allocation) to be treated as a zst allocation (so offsetting is only ok by zero) on the other hand we want to detect pointers to dead allocations

oli (Dec 21 2018 at 13:00, on Zulip):

I can do the full checking for that, but it seems that this would duplicate a lot of code from the Memory::get path

RalfJ (Dec 21 2018 at 14:56, on Zulip):

get could return an Option<&Allocation>, with None representing a ZST without backing allocation?

RalfJ (Dec 22 2018 at 09:18, on Zulip):

hm no that'll also not be good

RalfJ (Dec 22 2018 at 09:19, on Zulip):

@Oli what about extending get_size_and_align to also take a flag whether the allocation must be live?

oli (Dec 22 2018 at 14:27, on Zulip):

yea that seems the most reasonable course of action

oli (Dec 22 2018 at 14:27, on Zulip):

I mean it essentially resolves to the "full manual checking" but with some deduplication

RalfJ (Dec 22 2018 at 15:04, on Zulip):

yeah, it should actually not introduce new duplicates, just better use the existing ones ;)

Last update: Nov 15 2019 at 21:25UTC