Fix segfault due to reading non-existent memory
authorSimon Marlow <marlowsd@gmail.com>
Fri, 30 Oct 2015 18:53:44 +0000 (19:53 +0100)
committerBen Gamari <ben@smart-cactus.org>
Fri, 30 Oct 2015 18:53:45 +0000 (19:53 +0100)
commit2624298a0d81e348b879c521b9fae3f389ebab08
treeb62a0cab0864abdd246e59c3571508c892980e52
parent314395e00be10e6343840c215a4779aeec2542df
Fix segfault due to reading non-existent memory

It was possible to read non-existent memory, if we try to read the
srt_offset field of an info table when there is no SRT, and the info
table is right at the start of the text section.

This actually happened to me, I'm not sure why it never happened
before.

Test Plan: validate

Reviewers: rwbarton, ezyang, austin, bgamari

Reviewed By: austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1401
rts/sm/Scav.c