Re: Small memory bug in gimpact

"Bram Stolk" <[email protected]> Tue, 20 Nov 2007 08:41:36 -0800
Newsgroups gmane.comp.lib.ode
Message-ID <[email protected]>
--===============1847767165==
Content-Type: multipart/alternative; 
	boundary="----=_Part_25152_25670680.1195576896318"

------=_Part_25152_25670680.1195576896318
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Nov 19, 2007 11:37 PM, Daniel K. O. <[email protected]> wrote:

> Chunky Kibbles escreveu:
>
> > That *fp=0.0f is always assigning a value to the memory pointed to by
> > a a null pointer, which throws an exception here.
>
> That looks more like a poor man's assert(). I would prefer a SIGABRT +
> some descriptive message in stderr ("out of memory") than a SIGSEGV.
>

Indeed.
I changed it to an assert in the SVN trunk.

Note: I opted not to use dIASSERT(), although this one gives a nice abort,
and is used throughout ode, it turned out that nowhere in GIMPACT any
reference is made to ODE includes. I did not wat to polute the GIMPACT src
with ODE includes, so I use assert.h which was already used in GIMPACT, so
it cannot break any builds.

  Bram


-- 
Zapp: Captain's log, stardate...er..
Kif: Ohhh. April 13th.
Zapp: April 13th. Point 2.

------=_Part_25152_25670680.1195576896318
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<br><br><div class="gmail_quote">On Nov 19, 2007 11:37 PM, Daniel K. O. &lt;<a href="mailto:[email protected]">[email protected]</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Chunky Kibbles escreveu:<br><div class="Ih2E3d"><br>&gt; That *fp=0.0f is always assigning a value to the memory pointed to by<br>&gt; a a null pointer, which throws an exception here.<br><br></div>That looks more like a poor man&#39;s assert(). I would prefer a SIGABRT +
<br>some descriptive message in stderr (&quot;out of memory&quot;) than a SIGSEGV.<br><font color="#888888"></font></blockquote><div><br>Indeed.<br>I changed it to an assert in the SVN trunk.<br><br>Note: I opted not to use dIASSERT(), although this one gives a nice abort, and is used throughout ode, it turned out that nowhere in GIMPACT any reference is made to ODE includes. I did not wat to polute the GIMPACT src with ODE includes, so I use 
assert.h which was already used in GIMPACT, so it cannot break any builds.<br><br>&nbsp; Bram<br><br></div></div><br>-- <br>Zapp: Captain&#39;s log, stardate...er..<br>Kif: Ohhh. April 13th.<br>Zapp: April 13th. Point 2.

------=_Part_25152_25670680.1195576896318--

--===============1847767165==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ODE mailing list
[email protected]
http://ode.org/mailman/listinfo/ode
--===============1847767165==--