!UPSTREAM: WIP: adapt overflow-edge-cases for GS

So far I've just adapted it to be able to run in a core context.