Move the stack layout computation into its own module.
This is trying to keep algorithms out if the ir module which deals with the intermediate representation. Also give the layout_stack() function a Result return value so it can report a soft error when the stack frame is too large instead of asserting. Since local variables can be arbitrarily large, it is easy enough to overflow the stack with even a small function.
This commit is contained in:
@@ -7,7 +7,7 @@ use std::fmt;
|
||||
/// A compilation error.
|
||||
///
|
||||
/// When Cretonne fails to compile a function, it will return one of these error codes.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum CtonError {
|
||||
/// An IL verifier error.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user