mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 08:21:09 +00:00
declare immutable globals during in declare (#108)
Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
@@ -27,18 +27,6 @@ impl Entry {
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
context.declare_global(
|
|
||||||
revive_runtime_api::immutable_data::GLOBAL_IMMUTABLE_DATA_POINTER,
|
|
||||||
context.word_type().array_type(0),
|
|
||||||
AddressSpace::Stack,
|
|
||||||
);
|
|
||||||
|
|
||||||
context.declare_global(
|
|
||||||
revive_runtime_api::immutable_data::GLOBAL_IMMUTABLE_DATA_SIZE,
|
|
||||||
context.xlen_type(),
|
|
||||||
AddressSpace::Stack,
|
|
||||||
);
|
|
||||||
|
|
||||||
let calldata_type = context.array_type(context.byte_type(), Self::MAX_CALLDATA_SIZE);
|
let calldata_type = context.array_type(context.byte_type(), Self::MAX_CALLDATA_SIZE);
|
||||||
context.set_global(
|
context.set_global(
|
||||||
crate::polkavm::GLOBAL_CALLDATA_POINTER,
|
crate::polkavm::GLOBAL_CALLDATA_POINTER,
|
||||||
@@ -195,6 +183,18 @@ where
|
|||||||
Some(inkwell::module::Linkage::External),
|
Some(inkwell::module::Linkage::External),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
context.declare_global(
|
||||||
|
revive_runtime_api::immutable_data::GLOBAL_IMMUTABLE_DATA_POINTER,
|
||||||
|
context.word_type().array_type(0),
|
||||||
|
AddressSpace::Stack,
|
||||||
|
);
|
||||||
|
|
||||||
|
context.declare_global(
|
||||||
|
revive_runtime_api::immutable_data::GLOBAL_IMMUTABLE_DATA_SIZE,
|
||||||
|
context.xlen_type(),
|
||||||
|
AddressSpace::Stack,
|
||||||
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user