[Bug 95419] [HSW][regression][bisect] RPG Maker game gives "invalid floating point operation" at startup

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon May 16 21:26:21 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=95419

--- Comment #5 from Matt Turner <mattst88 at gmail.com> ---
(In reply to dnord from comment #4)
> Created attachment 123797 [details] [review]
> patch2
> 
> Sorry, your patch did not helped, but your suggestion is right: it's
> division by zero, when total_wants = 0. This code uses unnecessary math
> tricks for trivial things for some reason. If one does the math it can be
> easily seen, that (remaining_space/total_wants) ratio always remains the
> same, so this error-prone hacky code can be replaced by equivalent clear
> one, which is not prone to division-by-zero errors. Patch attached (works
> for me). Please review.

Thank you. That looks good.

If I might make two suggestions, which you're welcome to do as a follow on
patch: (1) replace the (double) cast with (float) (commit af5ca43 added new
code using doubles, which was a rebasing mistake on top of commit c1da1570),
and (2) use lroundf() instead of round().

Can you please send the patch to mesa-dev at lists.freedesktop.org using git
send-email? Also, please make sure git is configured with your name and email.

Thanks!

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20160516/96826624/attachment-0001.html>


More information about the intel-3d-bugs mailing list