summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/Adjustor.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/rts/Adjustor.c b/rts/Adjustor.c
index 789bd691c4..873f3acad1 100644
--- a/rts/Adjustor.c
+++ b/rts/Adjustor.c
@@ -491,22 +491,15 @@ createAdjustor(int cconv, StgStablePtr hptr,
*/
{
- int i = 0;
- int fourthFloating;
- char *c;
StgWord8 *adj_code;
// determine whether we have 4 or more integer arguments,
// and therefore need to flush one to the stack.
- for (c = typeString; *c != '\0'; c++) {
- i++;
- if (i == 4) {
- fourthFloating = (*c == 'f' || *c == 'd');
- break;
- }
- }
+ if ((typeString[0] == '\0') ||
+ (typeString[1] == '\0') ||
+ (typeString[2] == '\0') ||
+ (typeString[3] == '\0')) {
- if (i < 4) {
adjustor = allocateExec(0x38,&code);
adj_code = (StgWord8*)adjustor;
@@ -525,6 +518,9 @@ createAdjustor(int cconv, StgStablePtr hptr,
}
else
{
+ int fourthFloating;
+
+ fourthFloating = (typeString[3] == 'f' || typeString[3] == 'd');
adjustor = allocateExec(0x58,&code);
adj_code = (StgWord8*)adjustor;
*(StgInt32 *)adj_code = 0x08ec8348;