actually do lco, and mark unsafe variables before the goals where they last occur, not just in the last goal

This commit is contained in:
Mark Thom
2020-02-26 21:57:57 -07:00
parent 1d79e22468
commit 993c6f0e7b
4 changed files with 116 additions and 116 deletions

View File

@@ -225,9 +225,12 @@ impl Index<RegType> for MachineState {
impl IndexMut<RegType> for MachineState {
fn index_mut(&mut self, reg: RegType) -> &mut Self::Output {
match reg {
RegType::Temp(temp) => &mut self.registers[temp],
RegType::Temp(temp) => {
&mut self.registers[temp]
}
RegType::Perm(perm) => {
let e = self.e;
&mut self.stack.index_and_frame_mut(e)[perm]
}
}
@@ -274,10 +277,10 @@ impl MachineState {
fn try_char_list(&self, addrs: Vec<Addr>) -> Result<String, MachineError> {
let mut chars = String::new();
let mut iter = addrs.iter();
while let Some(addr) = iter.next() {
let addr = self.store(self.deref(addr.clone()));
match addr {
Addr::Con(Constant::String(n, ref s))
if self.flags.double_quotes.is_chars() => {