[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52542] Weird behaviour of vertical concatenat
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #52542] Weird behaviour of vertical concatenation with empty char array |
Date: |
Tue, 28 Nov 2017 18:18:26 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Update of bug #52542 (project octave):
Status: Confirmed => Patch Submitted
_______________________________________________________
Follow-up Comment #7:
Of course, this turns out to be way, way more complicated. It appears the
actual issue is in the parse tree and the parser's concatenation of string
constants. I've attached a patch that works for me, but jwe should probably
review as this is not my area. It seems like there were points in the parsing
of
double([char(ones(1,0)); 'A'])
where the dimension vector (dv) of the first element was checked for emptiness
with
dv.zero_by_zero ()
However, there are other ways of having an empty matrix. It is possible that
the code should be reviewed and the construct above replaced with the one
below.
dv.any_zero ()
For the attached patch, there is another slight issue in that it doesn't flag
a warning when the dimensions are different as is done for other data types.
octave:1> double([char(ones(0,3)); 'A'])
ans = 65
octave:2> double([ones(0,3); 'A'])
error: vertical dimensions mismatch (0x3 vs 1x1)
(file #42512)
_______________________________________________________
Additional Item Attachment:
File name: bug52542.cset Size:1 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52542>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/