randomasiandude
randomasiandude
MModular
Created by randomasiandude on 9/19/2024 in #questions
Segmentation Fault Core dumped
Been hard stucking on running the follow function as binary in Linux. It can run by mojo run .mojo just fine but it just can’t be executed as a binary … and the only error I got is in the title.
fn get_codewords(owned padded: List[Int]) -> List[Int]:
var ecwords = List[Int](0)*64
var values = List[Int]()

for i in range(222):
var temp: Int = (padded[i] + ecwords[0]) % 929
for j in range(63, -1, -1):
var val: Int = temp * EC_LV5[j] % 929
var factor: Int = ecwords[64-j] if j > 0 else 0
ecwords[63-j] = (factor + 929 - val) % 929

return ecwords
fn get_codewords(owned padded: List[Int]) -> List[Int]:
var ecwords = List[Int](0)*64
var values = List[Int]()

for i in range(222):
var temp: Int = (padded[i] + ecwords[0]) % 929
for j in range(63, -1, -1):
var val: Int = temp * EC_LV5[j] % 929
var factor: Int = ecwords[64-j] if j > 0 else 0
ecwords[63-j] = (factor + 929 - val) % 929

return ecwords
EC_LV5 is 64 bytes of error correction codewords ECL_LV5 = ListInt
25 replies