opam-2.0.0
Volodymyr Shymanskyy 2 years ago
parent 03a4652520
commit 89964f456b

@ -78,7 +78,7 @@ def build_wasi(target):
run(f"""
mkdir -p {build_dir}
cd {build_dir}
cmake -DCMAKE_TOOLCHAIN_FILE="{WASI_SDK_PATH}/share/cmake/wasi-sdk.cmake" -DWASI_SDK_PREFIX="{WASI_SDK_PATH}" ../..
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE="{WASI_SDK_PATH}/share/cmake/wasi-sdk.cmake" -DWASI_SDK_PREFIX="{WASI_SDK_PATH}" ../..
cmake --build .
cp wasm3.wasm ../wasm3-{target['name']}.wasm
""")
@ -114,7 +114,7 @@ def build_musl(target):
export CC="../../{muslcc}"
export CFLAGS="{target['cflags']}"
export LDFLAGS="-static -s"
cmake -DBUILD_NATIVE=OFF ../..
cmake -GNinja -DBUILD_NATIVE=OFF ../..
cmake --build .
cp wasm3 ../wasm3-{target['name']}
""")

@ -679,8 +679,7 @@ M3Result PushConst (IM3Compilation o, u64 i_word, u8 i_type)
{
if (IsSlotAllocated (o, slot) and IsSlotAllocated (o, slot + 1))
{
u64 constant;
memcpy (&constant, &o->constants [slot - o->slotFirstConstIndex], sizeof (constant));
u64 constant = * (u64 *) & o->constants [slot - o->slotFirstConstIndex];
if (constant == i_word)
{
@ -701,9 +700,9 @@ _ (Push (o, i_type, slot));
{
u64 constant;
if (is64BitType) {
memcpy(&constant, & o->constants [i], sizeof(u64));
constant = * (u64 *) & o->constants [i];
} else {
memcpy(&constant, & o->constants [i], sizeof(u32));
constant = * (u32 *) & o->constants [i];
}
if (constant == i_word)
{
@ -740,10 +739,15 @@ _ (PushAllocatedSlotAndEmit (o, i_type));
d_m3Assert(constTableIndex < d_m3MaxConstantTableSize);
if (is64BitType) {
memcpy (& o->constants [constTableIndex], &i_word, sizeof(u64));
} else {
memcpy (& o->constants [constTableIndex], &i_word, sizeof(u32));
if (is64BitType)
{
u64 * constant = (u64 *) & o->constants [constTableIndex];
* constant = i_word;
}
else
{
u32 * constant = (u32 *) & o->constants [constTableIndex];
* constant = (u32) i_word;
}
_ (Push (o, i_type, slot));

@ -62,7 +62,7 @@
# endif
# ifndef d_m3RecordBacktraces
# define d_m3RecordBacktraces 0
# define d_m3RecordBacktraces 1
# endif
# ifndef d_m3EnableExceptionBreakpoint

Loading…
Cancel
Save