summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-04-09 22:44:03 -0600
committerKarl Williamson <khw@cpan.org>2020-04-12 16:12:05 -0600
commitd3e3ece8ff6b23dfbaa6eb6d1b2289cc6ad26ef6 (patch)
treea96af5465626aa572f08ff77fb24f9f1c9922efb /regcomp.h
parent3bc2a7809d92db3d5c7c838645f17fa7f3ebf94f (diff)
downloadperl-d3e3ece8ff6b23dfbaa6eb6d1b2289cc6ad26ef6.tar.gz
regcomp.c: Rmv C undefined behavior
One analyzer said that what this commit changes was C undefined behavior, in casting void* pointers. Right now, the only actual type it is called with is SV*, but I made it void*, because I thought it might be used more generally. But, it turns out that Unicode is planning on changing its regular expression processing requirements to where what I have no longer will make sense. And, since only SV* is actually used, this commit changes the void* to SV*, removing any undefined behavior, with no changes to program logic. The changes for the new Unicode direction will come in probably 5.34; their document is still in draft, but I anticipate it will soon be finalized.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/regcomp.h b/regcomp.h
index 2eb4a4f73a..9634e94e9a 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -151,14 +151,13 @@ struct regnode_1 {
U32 arg1;
};
-/* Node whose argument is 'void *', a pointer to void. This needs to be used
- * very carefully in situations where pointers won't become invalid because of,
- * say re-mallocs */
+/* Node whose argument is 'SV *'. This needs to be used very carefully in
+ * situations where pointers won't become invalid because of, say re-mallocs */
struct regnode_p {
U8 flags;
U8 type;
U16 next_off;
- void * arg1;
+ SV * arg1;
};
/* Similar to a regnode_1 but with an extra signed argument */