forked from AbleOS/holey-bytes
fixing a leaked reg bug when constant happens
This commit is contained in:
parent
6b7572f089
commit
802e8b5d55
|
@ -1242,6 +1242,7 @@ impl Codegen {
|
||||||
|
|
||||||
self.ci.emit(neg(dst.get(), oper.get()));
|
self.ci.emit(neg(dst.get(), oper.get()));
|
||||||
self.ci.free_loc(drop_loc);
|
self.ci.free_loc(drop_loc);
|
||||||
|
self.ci.regs.free(oper);
|
||||||
|
|
||||||
Some(Value::new(value.ty, dst))
|
Some(Value::new(value.ty, dst))
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,8 @@ use {
|
||||||
pub struct Logger;
|
pub struct Logger;
|
||||||
|
|
||||||
impl log::Log for Logger {
|
impl log::Log for Logger {
|
||||||
fn enabled(&self, metadata: &log::Metadata) -> bool {
|
fn enabled(&self, _: &log::Metadata) -> bool {
|
||||||
log::max_level() >= metadata.level()
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
fn log(&self, record: &log::Record) {
|
fn log(&self, record: &log::Record) {
|
||||||
|
|
|
@ -3,9 +3,11 @@ fn main() -> std::io::Result<()> {
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
log::set_logger(&hblang::Logger).unwrap();
|
log::set_logger(&hblang::Logger).unwrap();
|
||||||
|
log::set_max_level(log::LevelFilter::Error);
|
||||||
|
|
||||||
let args = std::env::args().collect::<Vec<_>>();
|
let args = std::env::args().collect::<Vec<_>>();
|
||||||
let args = args.iter().map(String::as_str).collect::<Vec<_>>();
|
let args = args.iter().map(String::as_str).collect::<Vec<_>>();
|
||||||
|
|
||||||
let opts = hblang::Options::from_args(&args)?;
|
let opts = hblang::Options::from_args(&args)?;
|
||||||
let file = args.iter().filter(|a| !a.starts_with('-')).nth(1).copied().unwrap_or("main.hb");
|
let file = args.iter().filter(|a| !a.starts_with('-')).nth(1).copied().unwrap_or("main.hb");
|
||||||
|
|
||||||
|
|
|
@ -1314,7 +1314,6 @@ pub fn report_to(
|
||||||
|
|
||||||
_ = writeln!(out, "{}", line.replace("\t", " "));
|
_ = writeln!(out, "{}", line.replace("\t", " "));
|
||||||
_ = writeln!(out, "{}^", " ".repeat(col - 1));
|
_ = writeln!(out, "{}^", " ".repeat(col - 1));
|
||||||
todo!()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Hash)]
|
#[derive(PartialEq, Eq, Hash)]
|
||||||
|
|
Loading…
Reference in a new issue