comparison dyncallback/dyncall_args_x64.c @ 554:4d87bd4890b0

win64 callback dcbArgAggr() retval fix
author Tassilo Philipp
date Mon, 20 Jun 2022 15:42:55 +0200
parents eef302b7a58d
children b36a738c8975
comparison
equal deleted inserted replaced
553:a93bb23fca8c 554:4d87bd4890b0
132 assert(DC_FALSE && "unsupported SYSV aggregate slot classification"); /* shouldn't be reached, as we check for unupported classes earlier */ 132 assert(DC_FALSE && "unsupported SYSV aggregate slot classification"); /* shouldn't be reached, as we check for unupported classes earlier */
133 } 133 }
134 } 134 }
135 } 135 }
136 136
137 return target;
138
139 #else 137 #else
140 138
141 switch (ag->size) { 139 switch (ag->size) {
142 case 1: *(DCchar *)target = dcbArgChar (p); break; 140 case 1: *(DCchar *)target = dcbArgChar (p); break;
143 case 2: *(DCshort *)target = dcbArgShort (p); break; 141 case 2: *(DCshort *)target = dcbArgShort (p); break;
144 case 4: *(DClong *)target = dcbArgLong (p); break; 142 case 4: *(DClong *)target = dcbArgLong (p); break;
145 case 8: *(DClonglong*)target = dcbArgLongLong(p); break; 143 case 8: *(DClonglong*)target = dcbArgLongLong(p); break;
146 default: memcpy(target, dcbArgPointer(p), ag->size); break; 144 default: memcpy(target, dcbArgPointer(p), ag->size); break;
147 } 145 }
148 #endif 146 #endif
147
148 return target;
149 } 149 }
150 150
151 151
152 /* A 16 byte struct would be sufficient for System V (because at most two of the four registers can be full). */ 152 /* A 16 byte struct would be sufficient for System V (because at most two of the four registers can be full). */
153 /* But then it's much more complicated to copy the result to the correct registers in assembly. */ 153 /* But then it's much more complicated to copy the result to the correct registers in assembly. */