summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-12-25 05:44:23 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-12-25 05:44:23 -0800
commitc5cc3237190cc21fd5e0be13a3bf06942e5303a3 (patch)
tree2ff47c5fdaabba9e0d933fc1ade46b956c9c9ea8 /doio.c
parent492254706dd070a67dab2799fba515e6e4c3a3bb (diff)
downloadperl-c5cc3237190cc21fd5e0be13a3bf06942e5303a3.tar.gz
doio.c: Stop semop from modifying its argument
Perl_do_semop, which implements the Perl semop function, copies its second argument to a new struct array, which it passes to the system’s semop function. It then copies the contents of the struct back into the argument’s string buffer. Neither the Darwin nor Linux documentation says that semop modifies the structs passed to it, and, even if it did happen, perl has never handle it correctly. It would have to stringify its argument forcibly (to avoid copying back into a temporary string buffer) and also call get-magic. And then it would fail with a read-only argument. Since read-only arguments have always been permitted and the copy ing-back has never worked correctly, and since this will cause prob- lems if we upgrade modifications to COW buffers into crashes (the PERL_DEBUG_READONLY_COW mode I am working in), this commit removes that code.
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/doio.c b/doio.c
index b39c5876bd..fe74cc95db 100644
--- a/doio.c
+++ b/doio.c
@@ -2293,15 +2293,6 @@ Perl_do_semop(pTHX_ SV **mark, SV **sp)
t++;
}
result = semop(id, temps, nsops);
- t = temps;
- o = ops;
- i = nsops;
- while (i--) {
- *o++ = t->sem_num;
- *o++ = t->sem_op;
- *o++ = t->sem_flg;
- t++;
- }
Safefree(temps);
return result;
}