nac3artiq: correct global name for const object

This commit is contained in:
ychenfo 2022-05-16 02:50:42 +08:00
parent b9259b1907
commit 2cb725b7ac

View File

@ -99,7 +99,7 @@ impl StaticValue for PythonValue {
_: &mut dyn CodeGenerator, _: &mut dyn CodeGenerator,
) -> BasicValueEnum<'ctx> { ) -> BasicValueEnum<'ctx> {
ctx.module ctx.module
.get_global(self.id.to_string().as_str()) .get_global(format!("{}_const", self.id).as_str())
.map(|val| val.as_pointer_value().into()) .map(|val| val.as_pointer_value().into())
.unwrap_or_else(|| { .unwrap_or_else(|| {
Python::with_gil(|py| -> PyResult<BasicValueEnum<'ctx>> { Python::with_gil(|py| -> PyResult<BasicValueEnum<'ctx>> {