mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
runtime: call initRand() before initHeap() during initialization.
The reason is that allocating without a heap is usually more visible than using an uninitialized random generator which is subtle and may lead to security vulnerabilities. Based on suggestion from @eliasnaur Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -135,8 +135,8 @@ func sleep(duration int64) {
|
||||
// This function is called on the first core in the system. It will wake up the
|
||||
// other cores when ready.
|
||||
func run() {
|
||||
initHeap()
|
||||
initRand()
|
||||
initHeap()
|
||||
|
||||
go func() {
|
||||
// Package initializers are currently run single-threaded.
|
||||
|
||||
Reference in New Issue
Block a user