[Issue 9449] Segmentation fault in main()
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 21 10:52:47 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9449
Maxim Fomin <maxim at maxim-fomin.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
--- Comment #9 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-04-21 10:52:44 PDT ---
(In reply to comment #7)
> 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.
I think it does matter whether dynamic array was passed or a static one due to
how arguments are passed.
> (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.
I see no difference between length dynamic array property and your "lower 64
bits of value" (also between ptr and "higher 64 bits of value"). And passing a
pointer to dynamic array is not the same thing as passing pointer to the first
element: http://dpaste.dzfl.pl/8f91aed8
--
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