develooper Front page | perl.perl5.porters | Postings from April 2018

[perl #133113] [PATCH] fix SEGV inXS::APItest::Backrefs::Comctl32Version()

Thread Previous | Thread Next
From:
bulk88 via RT
Date:
April 14, 2018 20:57
Subject:
[perl #133113] [PATCH] fix SEGV inXS::APItest::Backrefs::Comctl32Version()
Message ID:
rt-4.0.24-11980-1523739439-47.133113-15-0@perl.org
>From 5bcf555c8adbaf5127416f50701b26026e28f214 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Thu, 12 Apr 2018 14:53:09 -0400
Subject: [PATCH] fix SEGV in XS::APItest::Backrefs::Comctl32Version()

really old Mingw GCCs (3.4.5 specifically) dont implement _alloca
correctly, switch to a simpler variation

a follow on to perl #133084 and see also problems I had with alloca on
very old GCCs in https://rt.cpan.org/Public/Bug/Display.html?id=80217
---
 ext/XS-APItest/APItest.pm | 2 +-
 ext/XS-APItest/APItest.xs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ext/XS-APItest/APItest.pm b/ext/XS-APItest/APItest.pm
index 8eda0f7..b98ccf8 100644
--- a/ext/XS-APItest/APItest.pm
+++ b/ext/XS-APItest/APItest.pm
@@ -5,7 +5,7 @@ use strict;
 use warnings;
 use Carp;
 
-our $VERSION = '0.96';
+our $VERSION = '0.97';
 
 require XSLoader;
 
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index 18e5b1c..b9e9b09 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -6808,7 +6808,7 @@ Comctl32Version()
             croak("Comctl32Version: comctl32.dll no version???");
         ver = LoadResource(dll, hrsc);
         len = SizeofResource(dll, hrsc);
-        vercopy = _alloca(len);
+        vercopy = (void *)sv_grow(sv_newmortal(),len);
         memcpy(vercopy, ver, len);
         if (VerQueryValue(vercopy, "\\", (void**)&info, &len)) {
             int dwValueMS1 = (info->dwFileVersionMS>>16);
-- 
2.5.0.windows.1



---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133113

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About