summaryrefslogtreecommitdiff
path: root/src/perl/perl-core.c
AgeCommit message (Collapse)Author
2017-02-28Don't emit the script destroyed signal before script is actually destroyedStephen Oberholtzer
The script unloading code originally worked like this: 1. Destroy package 2. Emit 'script destroyed' signal 3. Unhook script's signal handlers If a script added a 'script destroyed' signal handler, unloading that script would cause the 'script destroyed' signal to be sent to the (already destroyed) package. This would cause a script error, which would trigger a script unload, which would start the whole process over again, until we run out of heap or stack space and segfault. This commit simply reorders the operations so that the 'script destroyed' signal is sent *after* the script is fully destroyed.
2017-01-15perl_parse needs NULL terminated parameter list.Hanno
2016-09-11Add a '-autorun' switch to /script resetLemonBoy
This way we reload all the scripts in the autorun folder.
2016-01-11Merge pull request #393 from ailin-nemui/moduleversion-perlailin-nemui
forward ABI to perl modules
2015-12-13ensure staticlib perl works on 5.22 (for now)ailin-nemui
2015-12-10deinit perl on staticperl buildsailin-nemui
2015-12-10module check irssi versionailin-nemui
Add explicit checks into every module to match the ABI version defined in common.h
2015-04-07Change all strcmp() to g_strcmp0() to handle nulls gracefullydequis
Just a string replacement (but i did check every one of them) sed -i 's/strcmp(/g_strcmp0(/g' **/*.c
2014-06-29Merge pull request #52 from dgl/stack-cleanupAlexander Færøy
Correct use of perl stack macros
2014-06-29Merge pull request #49 from dgl/stackemAlexander Færøy
Move PUTBACK to within the scope which uses the stack
2014-06-27Merge pull request #44 from dajohi/g_basenameAlexander Færøy
Replace deprecated g_basename with g_path_get_basename.
2014-06-27Merge pull request #59 from ailin-nemui/perl-pl-naAlexander Færøy
get rid of PL_na
2014-06-27Correct use of perl stack macrosDavid Leadbeater
Further to pull #49 this is the result of an audit of the use of perl stack macros. There were several cases where PUTBACK was being called where the stack pointer could be out-of-date. Also some misc. cleanup where the macros were used needlessly.
2014-06-27Switch to using G_DISCARD for call_pvDavid Leadbeater
PUTBACK was being called even for the error path which didn't use the stack. Emitting the "script error" signal can involve running Perl code (Irssi:core::destroy) therefore the stack can be reallocated. This can result in the perl stack being corrupted because the local stack pointer is out of date (although as it's use of freed memory the crash is not always instant).
2014-06-24Define PERL_NO_GET_CONTEXT in all perl source filesDavid Leadbeater
This removes the calls to Perl_get_context() that get automatically added to XS code for ancient source code compatibility reasons. The result is about a ~60K size reduction in the binary (based on comparing two 64-bit stripped irssi binaries compiled --with-perl-staticlib).
2014-06-24get rid of PL_naLukas Mai
2014-06-22Replace deprecated g_basename with g_path_get_basename.David Hill
2009-04-05Fix r4998 change, declare 'environ'.Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5058 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-08Code Cleanup:Alexander Færøy
Use g_string_printf() instead of g_string_sprintf() (which is considered deprecated.) git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5004 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-23Call PERL_SYS_INIT3() and PERL_SYS_TERM() as documented in perlembed(1).Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4998 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-17Revert r4871, it breaks /script reset.Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4992 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-16Properly unload the original script when using /script load to reload it.Emanuele Giaquinta
bug #525, patch by Lukas Mai. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4991 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-01-15Use PERL_SYS_INIT3 with the correct pointer type for argv.Jilles Tjoelker
This fixes perl crashes on startup on some machines. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4989 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-08-23Fix crash on startup if perl is compiled in.Jilles Tjoelker
bug #618 git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4872 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-08-22Call PERL_SYS_INIT3() and PERL_SYS_TERM() as documented in perlembed(1), patchEmanuele Giaquinta
by Gerfried Fuchs (debian bug #495059). git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4871 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-05-13Set PL_perl_destruct_level to 1 before calling perl_destruct, withoutEmanuele Giaquinta
it /script reset may cause irssi to crash. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4817 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-02-05Remove support for perl 5.004 and older.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4706 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-02-02Remove unneeded include.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4697 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Oops. Update address correctly now.Wouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4490 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Update FSF addressWouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4489 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-03Remove broken code that prevents unloading of a script in some cases.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4473 dbcabf3a-b0e7-0310-adc4-f8d773084564
2006-09-12Don't crash on /quit with scripts causing and catching signals during UNLOAD ↵Wouter Coekaerts
(thanks senneth) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4340 dbcabf3a-b0e7-0310-adc4-f8d773084564
2005-02-06Fixed memory leaks when destroying a channel, when loading nonexisten ↵Valentin Batz
scripts and in topics, patch by Toby Peterson git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3707 dbcabf3a-b0e7-0310-adc4-f8d773084564
2003-06-27don't unload libraries when deinitializing. leaks some more memory, but ↵Timo Sirainen
fixes some crashes. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3117 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-09-19support for threaded perl. patch by mls@suse.deTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2930 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-08-25If script returns 0 while it's being loaded, it's terminated without anyTimo Sirainen
error message. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2885 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-03-24destruct level isn't touched anymore, it crashes irssi with a few people..Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2641 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-02-01Removed some backwards compatibility code between CVS versions that brokeTimo Sirainen
/SET use_perl_lib git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2367 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-01-27toupper(), tolower(), isspace(), is..etc..() aren't safe with chars in someTimo Sirainen
systems, use our own is_...() functions now instead. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2348 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-01-10g_strdup() the error message before emitting "script error" signal, sinceTimo Sirainen
perl scripting might be executed during that signal and it clears the error message. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2302 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-12-11I always forget Perl 5.004 doesn't have PL_na .. so, now I've declared forTimo Sirainen
5.004, and changed all STRLEN n_a code to use PL_na instead. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2238 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-12-06Irssi::signal_add(), Irssi::timeout_add(), Irssi::input_add() and theirTimo Sirainen
variants now also allow use of code references. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2199 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-12-03a bit more proper initializing of Irssi package..Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2180 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-12-03removed unused variableTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2178 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-11-25/SCRIPT LOAD modifies the script name so that all non-alphanumericTimo Sirainen
characters are translated to '_' char .. now this behaviour is done also when /SCRIPT UNLOAD is done, so people don't get confused why their "test-1" script can't be unloaded. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2145 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-11-19Settings of perl scripts are now stored in "perl/core/scripts" instead ofTimo Sirainen
old "perl/core". The settings are automatically moved to the perl/core/scripts for now - this will be removed before 0.7.99 comes out. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2101 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-11-18/SCRIPT UNLOAD didn't destroy the perl package from memory. Also the scriptsTimo Sirainen
weren't destroyed when error occured in them. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2053 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-11-11Updated perl API version. Fixed irssi to behave better if the API doesn'tTimo Sirainen
match (doesn't crash). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1985 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-10-25Boot dynaloader too even if perl libraries are compiled statically in irssi.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1917 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-10-24typofix - s/per/perl/Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1916 dbcabf3a-b0e7-0310-adc4-f8d773084564