logoalt Hacker News

ameliusyesterday at 9:01 PM2 repliesview on HN

It doesn't matter if the answer is wrong. You run the test program and then replace the code by the answer. This basically weeds out the UB.


Replies

1718627440today at 12:35 PM

That's a valid approach, if you only use high-level language to generate assembly faster, and the assembly is your source of truth.

yongjikyesterday at 9:22 PM

But since it is a UB, there's no guarantee that your test program produces the same result as the same code running on production, even if you have the same compiler.

show 1 reply