Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/modules/lua always put the module on the stack



details:   https://anonhg.NetBSD.org/src/rev/7d715362d24f
branches:  trunk
changeset: 353749:7d715362d24f
user:      mbalmer <mbalmer%NetBSD.org@localhost>
date:      Sat May 20 09:46:17 2017 +0000

description:
always put the module on the stack

diffstat:

 sys/modules/lua/lua.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r 2e7eebf20ace -r 7d715362d24f sys/modules/lua/lua.c
--- a/sys/modules/lua/lua.c     Sat May 20 08:31:13 2017 +0000
+++ b/sys/modules/lua/lua.c     Sat May 20 09:46:17 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lua.c,v 1.22 2017/05/20 08:31:13 mbalmer Exp $ */
+/*     $NetBSD: lua.c,v 1.23 2017/05/20 09:46:17 mbalmer Exp $ */
 
 /*
  * Copyright (c) 2011 - 2017 by Marc Balmer <mbalmer%NetBSD.org@localhost>.
@@ -514,16 +514,16 @@
        if (md != NULL)
                LIST_FOREACH(s, &lua_states, lua_next)
                        if (s->K->L == L) {
-                               LIST_FOREACH(m, &s->lua_modules, mod_next)
-                                       if (m == md)
-                                               return 1;
-
                                if (lua_verbose)
                                        device_printf(sc_self,
                                            "require module %s\n",
                                            md->mod_name);
                                luaL_requiref(L, md->mod_name, md->open, 0);
 
+                               LIST_FOREACH(m, &s->lua_modules, mod_next)
+                                       if (m == md)
+                                               return 1;
+
                                md->refcount++;
                                LIST_INSERT_HEAD(&s->lua_modules, md, mod_next);
                                return 1;



Home | Main Index | Thread Index | Old Index