shithub: mc

Download patch

ref: 79494c975307b4c5c82c836587002140b31b3b10
parent: c921181ad85c1d1c4f516221adfbbb510fe64d6d
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Jun 7 10:50:47 EDT 2017

Add assert for magic in slice capacity check.

--- a/lib/std/alloc.myr
+++ b/lib/std/alloc.myr
@@ -170,6 +170,7 @@
 	var phdr
 
 	phdr = ((p : size) - align(sizeof(slheader), Align) : slheader#)
+	std.iassert(phdr.magic == (0xdeadbeefbadf00d : size), "corrupt header")
 	-> phdr.cap
 }