tgl icon indicating copy to clipboard operation
tgl copied to clipboard

Fixes #100. We can assume it is working.

Open gurelkaynak opened this issue 9 years ago • 3 comments

without assert(0) the else if block works fine. There are no errors, builds and runs successfully.

gurelkaynak avatar Mar 31 '16 09:03 gurelkaynak

Have you actually tested that? I doubt that the following part works:

htobe64(val);
TGLC_bn_bin2bn ((unsigned char *) &val, 8, b);

It should probably say:

val = htobe64(val);
TGLC_bn_bin2bn ((unsigned char *) &val, 8, b);

... because htobe64 doesn't write into val, nothing happens on Little Endian systems, so I would be surprised if that actually does something useful.

EDIT: Yeah, I'm aware that I wrote that code. These two lines are broken nevertheless.

BenWiederhake avatar Jun 09 '16 11:06 BenWiederhake

The case was like this. I cloned everything, then configure, make and everything. It gave me the assert error on that line. When I went to the code this was the place that was broken, so I removed the assert(0) and everything worked fine. So, yes I had to test it to make it run.

gurelkaynak avatar Jun 20 '16 13:06 gurelkaynak

You mentioned one assert-induced crash, but removed two asserts. Which one crashed? And what argument do you have about why the "probably-faulty" code could possibly work?

BenWiederhake avatar Jun 21 '16 20:06 BenWiederhake