[Issue 9449] Segmentation fault in main()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 21 09:27:07 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9449



--- Comment #8 from John Colvin <john.loughran.colvin at gmail.com> 2013-04-21 17:27:06 BST ---
(In reply to comment #7)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > Seems to be related to bug 8518.
> > 
> > Thanks for founding. The root of the problem (at least this one) is when dmd
> > frontend parses and generates list of expressions, it does not create "hidden"
> > expression which calls _memset128ii. Instead it does this when it executes
> > AssignExpression::toElem() and later calls setArray() which issues call to
> > _memset128ii. However it does not convert ubyte16[1] from static array to
> > dynamic array and passes it as a static array. Since _memset128ii expects
> > dynamic array, the program goes off the rails.
> 
> I'm pretty sure the use of void[] in _memset128ii is simply so as to have a
> 128bit data type. It's never used as, or expected to be, an array.
> 
> _memset128ii doesn't care whether it's being passed a static or dynamic array,
> it just blindly increments a pointer and writes to it "count" times.
> 
> (In reply to comment #3)
> > _memset128ii expects:
> > 
> > %rcx => size_t count
> > %rdx => .ptr of value array
> > $rsi => .length of value array
> > %rdi => pointer to first argument array 
> 
> This is incorrect. _memset128 expects:
> 
> RCX: size_t count
> RDX: higher 64 bits of value
> RSI: lower 64 bits of value
> RDI: pointer to the 1st element of the destination array.

/s/_memset128/_memset128ii

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list