8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
readMemoryAt
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried the following test code at test/memory.hs:
test/memory.hs
putStrLn "Read memory at 0x1003..." x <- readMemoryAt store memory 0x1003 4 B.decode (LBS.fromStrict x) @?= (4 :: Int32)
But it failed without so much as returning a Left value. Then, I checked the code of readMemoryAt:
Left
readMemoryAt store mem offset sz = do max_sz <- getMemorySizeBytes store mem unsafeIOToPrim $ do if offset + sz > max_sz then pure $ Left MemoryAccessError else do res <- unsafeWithMemory store mem $ \mem_data_ptr mem_size -> BI.create (fromIntegral mem_size) $ \dst_ptr -> copyBytes dst_ptr (advancePtr mem_data_ptr (fromIntegral offset)) (fromIntegral mem_size) pure $ Right res
It seems to return the entire memory with the offset. When I set the offset to 0, it yielded a very long byte string.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I tried the following test code at
test/memory.hs
:But it failed without so much as returning a
Left
value. Then, I checked the code ofreadMemoryAt
:It seems to return the entire memory with the offset. When I set the offset to 0, it yielded a very long byte string.
The text was updated successfully, but these errors were encountered: