Overview
Comment: | Fix two bugs in sel_registerName.
The first was that sel_registerName would crash if no selector has ever The second one was that the hashtable was read without a lock to see if |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e5b241b72d11c754c53d946cc8a8a5bb |
User & Date: | js on 2012-07-09 21:10:59 |
Other Links: | manifest | tags |
Context
2012-07-10
| ||
22:01 | New platforms list. check-in: 1d67417011 user: js tags: trunk | |
2012-07-09
| ||
21:10 | Fix two bugs in sel_registerName. check-in: e5b241b72d user: js tags: trunk | |
2012-07-08
| ||
13:34 | objfw-config: Always add -funwind-tables. check-in: 8f50777186 user: js tags: trunk | |
Changes
Modified src/runtime/selector.m from [ce39c495db] to [f1aef89fda].
︙ | ︙ | |||
62 63 64 65 66 67 68 | SEL sel_registerName(const char *name) { const struct objc_abi_selector *rsel; struct objc_abi_selector *sel; | > > > | > > < < > | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | SEL sel_registerName(const char *name) { const struct objc_abi_selector *rsel; struct objc_abi_selector *sel; objc_global_mutex_lock(); if (selectors != NULL && (rsel = objc_hashtable_get(selectors, name)) != NULL) { objc_global_mutex_unlock(); return (SEL)rsel; } /* FIXME: Free on objc_exit() */ if ((sel = malloc(sizeof(struct objc_abi_selector))) == NULL) ERROR("Not enough memory to allocate selector!"); if ((sel->name = strdup(name)) == NULL) ERROR("Not enough memory to allocate selector!"); sel->types = NULL; objc_register_selector(sel); objc_global_mutex_unlock(); return (SEL)sel; } void objc_register_all_selectors(struct objc_abi_symtab *symtab) { struct objc_abi_selector *sel; |
︙ | ︙ |