|
From: | Elias Mårtenson |
Subject: | Re: [Bug-apl] Possible bug in PrintBuffer.cc |
Date: | Tue, 14 Jan 2014 16:51:50 +0800 |
I came up with:On 14 January 2014 08:34, Elias Mårtenson <address@hidden> wrote:
> Another potential bug showing up when I was going through the warning
> messages:
>
> In PrintBuffer.cc, line 70, the following code is found:
>
> const ShapeItem ec = value.element_count();
> if (ec == 0) // empty value of any dimension
> {
> const Shape sh = value.get_shape().without_axis(sh.get_rank() - 1);
> if (sh.get_volume() <= 1) // empty vector
> {
>
>
> The call to sh.get_rank() refers sh itself before it's initialised. I'm not
> sure what the intent of this code is, so I don't want to guess how to fix
> it.
Index: PrintBuffer.cc
===================================================================
--- PrintBuffer.cc (revision 90)
+++ PrintBuffer.cc (working copy)
@@ -67,7 +67,7 @@
const ShapeItem ec = value.element_count();- const Shape sh = value.get_shape().without_axis(sh.get_rank() - 1);
if (ec == 0) // empty value of any dimension
{
+ const Shape sh = value.get_shape().without_axis(value.get_rank() - 1);
if (sh.get_volume() <= 1) // empty vectorif (pctx.get_style() == PR_APL_FUN)
{
Jay.
[Prev in Thread] | Current Thread | [Next in Thread] |